Skip to content

Commit 7c77b54

Browse files
Address yet another, quasi-baffling incarnation of NREL#365 - temporary file drive appears to have changed from D: to C:, so strip C: as well, but this should not have been necessary with how the AssertionError is being caught in _assert_file_paths_equal...unless os.name is somehow wrong or TOXPYTHON env var is not set...
1 parent d37e39c commit 7c77b54

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/geophires_x_tests/test_outputs.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_relative_output_file_path(self):
4949
self.assertTrue(html_filepath.is_absolute())
5050

5151
expected_path = str(Path('/tmp/foo.html')) # noqa: S108
52-
self._assert_file_paths_equal(str(html_filepath).replace('D:', ''), expected_path)
52+
self._assert_file_paths_equal(self._strip_drive(str(html_filepath)), expected_path)
5353

5454
def test_absolute_output_file_path(self):
5555
input_file = GeophiresInputParameters(
@@ -59,9 +59,13 @@ def test_absolute_output_file_path(self):
5959
html_filepath = Path(m.outputs.html_output_file.value)
6060
self.assertTrue(html_filepath.is_absolute())
6161
self._assert_file_paths_equal(
62-
str(html_filepath).replace('D:', ''), str(Path('/home/user/my-geophires-project/foo.html'))
62+
self._strip_drive(str(html_filepath)), str(Path('/home/user/my-geophires-project/foo.html'))
6363
)
6464

65+
# noinspection PyMethodMayBeStatic
66+
def _strip_drive(self, p: str) -> str:
67+
return p.replace('D:', '').replace('C:', '')
68+
6569
def _assert_file_paths_equal(self, file_path_1, file_path_2):
6670
try:
6771
self.assertEqual(file_path_1, file_path_2)

0 commit comments

Comments
 (0)