diff options
author | MR Lemon <matt@matthewlemon> | 2020-05-17 11:00:36 +0100 |
---|---|---|
committer | MR Lemon <matt@matthewlemon> | 2020-05-17 11:00:36 +0100 |
commit | 05b80c9ece0faaf3b5f7c1ac3284ebf37f273683 (patch) | |
tree | 5d923240b6e385a04e90ed2c56362795ba543c0f /datamaps | |
parent | 5e9d41e5d2fbb477d1cb96a53c6fce4db893f115 (diff) |
checking for win32 path style in test
Diffstat (limited to 'datamaps')
-rw-r--r-- | datamaps/tests/test_cli.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/datamaps/tests/test_cli.py b/datamaps/tests/test_cli.py index d5f2ffe..099d93b 100644 --- a/datamaps/tests/test_cli.py +++ b/datamaps/tests/test_cli.py @@ -5,6 +5,7 @@ from pathlib import Path import pytest from click.testing import CliRunner +from sys import platform from datamaps.main import _import, export @@ -30,12 +31,15 @@ def test_import_with_alternative_datamap(mock_config, resource_dir, caplog): mock_config.initialise() caplog.set_level(logging.INFO) _copy_resources_to_input(mock_config, resource_dir) - _alt_datamap_file = os.path.join(mock_config.PLATFORM_DOCS_DIR, "input", "datamap_alternate.csv") + _alt_datamap_file = mock_config.PLATFORM_DOCS_DIR / "input" / "datamap_alternate.csv" result = runner.invoke(_import, ["templates", "-m", "-d", _alt_datamap_file]) assert result.exit_code == 0 - assert "Reading datamap /tmp/Documents/datamaps/input/datamap_alternate.csv" in [x[2] for x in - caplog.record_tuples] - + if platform == "win32": + assert "Reading datamap \\tmp\\Documents\\datamaps\\input\\datamap_alternate.csv" in [x[2] for x in + caplog.record_tuples] + else: + assert "Reading datamap /tmp/Documents/datamaps/input/datamap_alternate.csv" in [x[2] for x in + caplog.record_tuples] def test_import_with_wrong_datamap(mock_config, resource_dir, caplog): """ @@ -69,8 +73,12 @@ def test_export_with_alternative_datamap_not_csv(mock_config, resource_dir, capl _master_file = os.path.join(mock_config.PLATFORM_DOCS_DIR, "input", "master.xlsx") _alt_datamap_file = os.path.join(mock_config.PLATFORM_DOCS_DIR, "input", "datamap_alternate.csv") _ = runner.invoke(export, ["master", _master_file, "-d", _alt_datamap_file]) - assert "Reading datamap /tmp/Documents/datamaps/input/datamap_alternate.csv" in [x[2] for x in - caplog.record_tuples] + if platform == "win32": + assert "Reading datamap \\tmp\\Documents\\datamaps\\input\\datamap_alternate.csv" in [x[2] for x in + caplog.record_tuples] + else: + assert "Reading datamap /tmp/Documents/datamaps/input/datamap_alternate.csv" in [x[2] for x in + caplog.record_tuples] @pytest.mark.skip("Not currently passing - need to investigate") |