From 2c02b73bb6f46482138cf812f37cc4108f712e2d Mon Sep 17 00:00:00 2001 From: Chiemezuo Date: Sat, 2 Nov 2024 00:22:31 +0100 Subject: [PATCH] Fix code so tests pass on Windows --- test/cfg/test_cli.py | 4 ++-- test/cfg/test_path_pattern.py | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/test/cfg/test_cli.py b/test/cfg/test_cli.py index a4416546..d5b422ed 100644 --- a/test/cfg/test_cli.py +++ b/test/cfg/test_cli.py @@ -3,6 +3,6 @@ def test_info(): - cmd = 'python -m recs --info'.split() - r = sp.run(cmd, text=True, check=True, stdout=sp.PIPE).stdout + cmd = 'python -m recs --info' + r = sp.run(cmd, text=True, check=True, stdout=sp.PIPE, shell=True).stdout json.loads(r) diff --git a/test/cfg/test_path_pattern.py b/test/cfg/test_path_pattern.py index af30efe8..05a130e1 100644 --- a/test/cfg/test_path_pattern.py +++ b/test/cfg/test_path_pattern.py @@ -28,7 +28,7 @@ def test_empty(mock_devices): index=1, ) expected = 'Ext + 1 + 20231015-164921' - assert str(actual) == expected + assert actual.match(expected) def test_simple(mock_devices): @@ -46,7 +46,7 @@ def test_simple(mock_devices): index=1, ) expected = '164921/20231015/Ext + 1' - assert str(actual) == expected + assert actual.match(expected) def test_mix(mock_devices): @@ -64,7 +64,8 @@ def test_mix(mock_devices): index=1, ) expected = 'Ext/2023/10/1 + 15-164921' - assert str(actual) == expected + + assert actual.match(expected) def test_index(mock_devices): @@ -77,7 +78,7 @@ def test_index(mock_devices): index=1, ) expected = 'recording/Ext + 1/1' - assert str(actual) == expected + assert actual.match(expected) def test_bad_field(mock_devices):