From 9bf540c82fe88eba83594cf24e0e59b2218a4d18 Mon Sep 17 00:00:00 2001 From: ayan <100955969+ayan1229@users.noreply.github.com> Date: Thu, 19 Dec 2024 16:35:47 -0500 Subject: [PATCH 1/2] SFR-2417/update end point names --- ...est_get_collection.py => test_get_collections.py} | 12 ++++++------ ...llection_list.py => test_get_collections_list.py} | 4 ++-- .../{test_get_edition.py => test_get_editions.py} | 12 ++++++------ .../api/{test_get_link.py => test_get_links.py} | 12 ++++++------ .../api/{test_get_work.py => test_get_works.py} | 12 ++++++------ 5 files changed, 26 insertions(+), 26 deletions(-) rename tests/integration/api/{test_get_collection.py => test_get_collections.py} (60%) rename tests/integration/api/{test_get_collection_list.py => test_get_collections_list.py} (79%) rename tests/integration/api/{test_get_edition.py => test_get_editions.py} (64%) rename tests/integration/api/{test_get_link.py => test_get_links.py} (66%) rename tests/integration/api/{test_get_work.py => test_get_works.py} (63%) diff --git a/tests/integration/api/test_get_collection.py b/tests/integration/api/test_get_collections.py similarity index 60% rename from tests/integration/api/test_get_collection.py rename to tests/integration/api/test_get_collections.py index 0a2f96c000..1f95813217 100644 --- a/tests/integration/api/test_get_collection.py +++ b/tests/integration/api/test_get_collections.py @@ -4,13 +4,13 @@ from .utils import assert_response_status @pytest.mark.parametrize("endpoint, expected_status", [ - ("/collection/3650664c-c8be-4d07-8d64-2d7003b02048", 200), - ("/collection/00000000-0000-0000-0000-000000000000", 404), - ("/collection/invalid_id_format", 400), - ("/collection/", 404), - ("/collection/%$@!*", 400) + ("/collections/3650664c-c8be-4d07-8d64-2d7003b02048", 200), + ("/collections/00000000-0000-0000-0000-000000000000", 404), + ("/collections/invalid_id_format", 400), + ("/collections/", 404), + ("/collections/%$@!*", 400) ]) -def test_get_collection(endpoint, expected_status): +def test_get_collections(endpoint, expected_status): url = API_URL + endpoint response = requests.get(url) diff --git a/tests/integration/api/test_get_collection_list.py b/tests/integration/api/test_get_collections_list.py similarity index 79% rename from tests/integration/api/test_get_collection_list.py rename to tests/integration/api/test_get_collections_list.py index 15b1ec9cdf..2b3e8e20d6 100644 --- a/tests/integration/api/test_get_collection_list.py +++ b/tests/integration/api/test_get_collections_list.py @@ -3,8 +3,8 @@ import requests -def test_get_collection(): - url = API_URL + '/collection/list?sort=title' +def test_get_collections(): + url = API_URL + '/collections?sort=title' response = requests.get(url) assert response.status_code is not None diff --git a/tests/integration/api/test_get_edition.py b/tests/integration/api/test_get_editions.py similarity index 64% rename from tests/integration/api/test_get_edition.py rename to tests/integration/api/test_get_editions.py index d931cb0c45..bf39df3dcd 100644 --- a/tests/integration/api/test_get_edition.py +++ b/tests/integration/api/test_get_editions.py @@ -4,13 +4,13 @@ from .utils import assert_response_status @pytest.mark.parametrize("endpoint, expected_status", [ - ("/edition/1982731", 200), - ("/edition/00000000-0000-0000-0000-000000000000", 400), - ("/edition/invalid_id_format", 400), - ("/edition/", 404), - ("/edition/%$@!*", 400) + ("/editions/1982731", 200), + ("/editions/00000000-0000-0000-0000-000000000000", 400), + ("/editions/invalid_id_format", 400), + ("/editions/", 404), + ("/editions/%$@!*", 400) ]) -def test_get_edition(endpoint, expected_status): +def test_get_editions(endpoint, expected_status): url = API_URL + endpoint response = requests.get(url) diff --git a/tests/integration/api/test_get_link.py b/tests/integration/api/test_get_links.py similarity index 66% rename from tests/integration/api/test_get_link.py rename to tests/integration/api/test_get_links.py index 22ca49f00f..e06c02f0e0 100644 --- a/tests/integration/api/test_get_link.py +++ b/tests/integration/api/test_get_links.py @@ -4,13 +4,13 @@ from .utils import assert_response_status @pytest.mark.parametrize("endpoint, expected_status", [ - ("/link/1982731", 200), - ("/link/00000000-0000-0000-0000-000000000000", 400), - ("/link/invalid_id_format", 400), - ("/link/", 404), - ("/link/%$@!*", 400) + ("/links/1982731", 200), + ("/links/00000000-0000-0000-0000-000000000000", 400), + ("/links/invalid_id_format", 400), + ("/links/", 404), + ("/links/%$@!*", 400) ]) -def test_get_link(endpoint, expected_status): +def test_get_links(endpoint, expected_status): url = API_URL + endpoint response = requests.get(url) diff --git a/tests/integration/api/test_get_work.py b/tests/integration/api/test_get_works.py similarity index 63% rename from tests/integration/api/test_get_work.py rename to tests/integration/api/test_get_works.py index 96d3cd4069..1cc3acb2f0 100644 --- a/tests/integration/api/test_get_work.py +++ b/tests/integration/api/test_get_works.py @@ -4,13 +4,13 @@ from .utils import assert_response_status @pytest.mark.parametrize("endpoint, expected_status", [ - ("/work/701c5f00-cd7a-4a7d-9ed1-ce41c574ad1d", 200), - ("/work/00000000-0000-0000-0000-000000000000", 404), - ("/work/invalid_id_format", 400), - ("/work/", 404), - ("/work/%$@!*", 400) + ("/works/701c5f00-cd7a-4a7d-9ed1-ce41c574ad1d", 200), + ("/works/00000000-0000-0000-0000-000000000000", 404), + ("/works/invalid_id_format", 400), + ("/works/", 404), + ("/works/%$@!*", 400) ]) -def test_get_work(endpoint, expected_status): +def test_get_works(endpoint, expected_status): url = API_URL + endpoint response = requests.get(url) From 18398142a3c3fbcc17b687363462af0d0b06df02 Mon Sep 17 00:00:00 2001 From: ayan <100955969+ayan1229@users.noreply.github.com> Date: Fri, 20 Dec 2024 08:25:57 -0500 Subject: [PATCH 2/2] name change updates --- .../api/{test_get_collections.py => test_get_collection.py} | 2 +- ...test_get_collections_list.py => test_get_collection_list.py} | 2 +- .../api/{test_get_editions.py => test_get_edition.py} | 2 +- tests/integration/api/{test_get_links.py => test_get_link.py} | 2 +- tests/integration/api/{test_get_works.py => test_get_work.py} | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename tests/integration/api/{test_get_collections.py => test_get_collection.py} (92%) rename tests/integration/api/{test_get_collections_list.py => test_get_collection_list.py} (92%) rename tests/integration/api/{test_get_editions.py => test_get_edition.py} (92%) rename tests/integration/api/{test_get_links.py => test_get_link.py} (92%) rename tests/integration/api/{test_get_works.py => test_get_work.py} (93%) diff --git a/tests/integration/api/test_get_collections.py b/tests/integration/api/test_get_collection.py similarity index 92% rename from tests/integration/api/test_get_collections.py rename to tests/integration/api/test_get_collection.py index 1f95813217..5949c5c4e9 100644 --- a/tests/integration/api/test_get_collections.py +++ b/tests/integration/api/test_get_collection.py @@ -10,7 +10,7 @@ ("/collections/", 404), ("/collections/%$@!*", 400) ]) -def test_get_collections(endpoint, expected_status): +def test_get_collection(endpoint, expected_status): url = API_URL + endpoint response = requests.get(url) diff --git a/tests/integration/api/test_get_collections_list.py b/tests/integration/api/test_get_collection_list.py similarity index 92% rename from tests/integration/api/test_get_collections_list.py rename to tests/integration/api/test_get_collection_list.py index 2b3e8e20d6..32ed2b98f4 100644 --- a/tests/integration/api/test_get_collections_list.py +++ b/tests/integration/api/test_get_collection_list.py @@ -3,7 +3,7 @@ import requests -def test_get_collections(): +def test_get_collection(): url = API_URL + '/collections?sort=title' response = requests.get(url) diff --git a/tests/integration/api/test_get_editions.py b/tests/integration/api/test_get_edition.py similarity index 92% rename from tests/integration/api/test_get_editions.py rename to tests/integration/api/test_get_edition.py index bf39df3dcd..65d10637ca 100644 --- a/tests/integration/api/test_get_editions.py +++ b/tests/integration/api/test_get_edition.py @@ -10,7 +10,7 @@ ("/editions/", 404), ("/editions/%$@!*", 400) ]) -def test_get_editions(endpoint, expected_status): +def test_get_edition(endpoint, expected_status): url = API_URL + endpoint response = requests.get(url) diff --git a/tests/integration/api/test_get_links.py b/tests/integration/api/test_get_link.py similarity index 92% rename from tests/integration/api/test_get_links.py rename to tests/integration/api/test_get_link.py index e06c02f0e0..96dea4ab87 100644 --- a/tests/integration/api/test_get_links.py +++ b/tests/integration/api/test_get_link.py @@ -10,7 +10,7 @@ ("/links/", 404), ("/links/%$@!*", 400) ]) -def test_get_links(endpoint, expected_status): +def test_get_link(endpoint, expected_status): url = API_URL + endpoint response = requests.get(url) diff --git a/tests/integration/api/test_get_works.py b/tests/integration/api/test_get_work.py similarity index 93% rename from tests/integration/api/test_get_works.py rename to tests/integration/api/test_get_work.py index 1cc3acb2f0..e2da49c532 100644 --- a/tests/integration/api/test_get_works.py +++ b/tests/integration/api/test_get_work.py @@ -10,7 +10,7 @@ ("/works/", 404), ("/works/%$@!*", 400) ]) -def test_get_works(endpoint, expected_status): +def test_get_work(endpoint, expected_status): url = API_URL + endpoint response = requests.get(url)