From 97d51920e7c063cfd58ae2f535f7412eed6a1485 Mon Sep 17 00:00:00 2001 From: Stefaan Lippens Date: Tue, 14 Nov 2023 11:46:53 +0100 Subject: [PATCH] Issue #195 flag 1.2 API version as production ready --- openeo_driver/_version.py | 2 +- openeo_driver/views.py | 6 +++--- tests/test_views.py | 21 +++++++++++++-------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/openeo_driver/_version.py b/openeo_driver/_version.py index 06efdede..618b8cd6 100644 --- a/openeo_driver/_version.py +++ b/openeo_driver/_version.py @@ -1 +1 @@ -__version__ = "0.76.1a1" +__version__ = "0.77.0a1" diff --git a/openeo_driver/views.py b/openeo_driver/views.py index 1dba4434..659329bd 100644 --- a/openeo_driver/views.py +++ b/openeo_driver/views.py @@ -49,10 +49,10 @@ "1.0.1": ApiVersionInfo(version="1.0.1", supported=True, wellknown=False, production=True), "1.1.0": ApiVersionInfo(version="1.1.0", supported=True, wellknown=False, production=False), "1.1": ApiVersionInfo(version="1.1.0", supported=True, wellknown=True, production=True), - "1": ApiVersionInfo(version="1.1.0", supported=True, wellknown=False, production=True), - "1.2": ApiVersionInfo(version="1.2.0", supported=True, wellknown=True, production=False), + "1.2": ApiVersionInfo(version="1.2.0", supported=True, wellknown=True, production=True), + "1": ApiVersionInfo(version="1.2.0", supported=True, wellknown=False, production=True), } -API_VERSION_DEFAULT = "1.1.0" +API_VERSION_DEFAULT = "1.2" _log.info("API Versions: {v}".format(v=API_VERSIONS)) _log.info("Default API Version: {v}".format(v=API_VERSION_DEFAULT)) diff --git a/tests/test_views.py b/tests/test_views.py index 3df97f50..6c5fbcc7 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -138,7 +138,7 @@ def test_well_known_openeo(self, client): assert by_api_version == { "1.0.0": {"api_version": "1.0.0", "production": True, "url": "http://oeo.net/openeo/1.0/"}, "1.1.0": {"api_version": "1.1.0", "production": True, "url": "http://oeo.net/openeo/1.1/"}, - "1.2.0": {"api_version": "1.2.0", "production": False, "url": "http://oeo.net/openeo/1.2/"}, + "1.2.0": {"api_version": "1.2.0", "production": True, "url": "http://oeo.net/openeo/1.2/"}, } assert resp.headers["Cache-Control"] == "max-age=900, public" @@ -154,13 +154,18 @@ def test_https_proxy_handling(self, client, headers, expected): for url in [v["url"] for v in resp.json["versions"]]: assert url.startswith(expected) - @pytest.mark.parametrize(["url", "expected_version"], [ - ("/openeo/1.0/", "1.0.0"), - ("/openeo/1.0.0/", "1.0.0"), - ("/openeo/1.1/", "1.1.0"), - ("/openeo/1.1.0/", "1.1.0"), - ("/openeo/", "1.1.0"), - ]) + @pytest.mark.parametrize( + ["url", "expected_version"], + [ + ("/openeo/1.0/", "1.0.0"), + ("/openeo/1.0.0/", "1.0.0"), + ("/openeo/1.1/", "1.1.0"), + ("/openeo/1.1.0/", "1.1.0"), + ("/openeo/1.2/", "1.2.0"), + ("/openeo/1/", "1.2.0"), + ("/openeo/", "1.2.0"), + ], + ) def test_versioned_urls(self, client, url, expected_version): resp = client.get(url) assert resp.status_code == 200