Absolute the intended result path

Because testing on Windows is going to add a drive to any absolute path, and
in the tests we don't want to make it specific to something like that, take
the absolute path to test against and then absolute it again which is pretty
much a NOP on a Unix-a-like, but will add the drive on Windows.
This commit is contained in:
Dave Pearson
2022-10-24 11:26:43 +01:00
parent 129857ff9e
commit d7da8c6851

View File

@@ -37,7 +37,7 @@ def path_tester(obj_type: Type[App[None]], str_type: Type[App[None]], intended_r
)
def test_relative_path():
path_tester(RelativePathObjectApp, RelativePathStrApp, ((Path(__file__).absolute().parent ) / "test.css"))
path_tester(RelativePathObjectApp, RelativePathStrApp, ((Path(__file__).absolute().parent ) / "test.css").absolute())
def test_absolute_path():
path_tester(AbsolutePathObjectApp, AbsolutePathStrApp, Path("/tmp/test.css"))
path_tester(AbsolutePathObjectApp, AbsolutePathStrApp, Path("/tmp/test.css").absolute())