From 7e11fa0217055ec2d49f4d91fec022519e6592bb Mon Sep 17 00:00:00 2001 From: Stefaan Lippens Date: Wed, 8 Jan 2025 16:06:56 +0100 Subject: [PATCH] test_views: parametrize api_version to 1.0, 1.1 and 1.2 related to #352 --- tests/test_views.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_views.py b/tests/test_views.py index 8e880ad6..5e06cff8 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -84,8 +84,9 @@ @pytest.fixture( params=[ - "1.0.0", - "1.1.0", + "1.0", + "1.1", + "1.2", ] ) def api_version(request) -> str: @@ -533,7 +534,7 @@ def test_processes(self, api, endpoint): def test_processes_exclusion(self, api, backend_config_overrides): resp = api.get('/processes').assert_status_code(200).json ids = [c["id"] for c in resp["processes"]] - if(api.api_version == "1.0.0"): + if ComparableVersion(api.api_version) == "1.0.0": assert "merge_cubes" not in ids else: assert "merge_cubes" in ids @@ -1031,10 +1032,9 @@ def test_collections(self, api): @pytest.mark.parametrize("backend_config_overrides", [{"collection_exclusion_list": {"1.0.0":["S2_FOOBAR"]}}]) def test_collections_exclusion(self, api, backend_config_overrides): - resp = api.get('/collections').assert_status_code(200).json ids = [c["id"] for c in resp["collections"]] - if(api.api_version == "1.0.0"): + if ComparableVersion(api.api_version) == "1.0.0": assert "S2_FOOBAR" not in ids else: assert "S2_FOOBAR" in ids