From e40d1f1054f21b7b50e273741c599abb92483791 Mon Sep 17 00:00:00 2001 From: vincentsarago Date: Thu, 28 Mar 2024 12:27:38 +0100 Subject: [PATCH] fix tests --- tests/test_factories.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/test_factories.py b/tests/test_factories.py index 35dd407..c23ec73 100644 --- a/tests/test_factories.py +++ b/tests/test_factories.py @@ -116,7 +116,7 @@ def test_tiles_factory(): endpoints = OGCTilesFactory() assert endpoints.with_common assert endpoints.title == "OGC API" - assert len(endpoints.router.routes) == 14 + assert len(endpoints.router.routes) == 15 assert len(endpoints.conforms_to) == 5 app = FastAPI() @@ -127,7 +127,7 @@ def test_tiles_factory(): assert response.headers["content-type"] == "application/json" assert response.json()["title"] == "OGC API" links = response.json()["links"] - assert len(links) == 9 # 5 from tiles + 4 from common + assert len(links) == 10 # 6 from tiles + 4 from common landing_link = [link for link in links if link["title"] == "Landing Page"][0] assert landing_link["href"] == "http://testserver/" tms_link = [link for link in links if link["title"] == "TileMatrixSets"][0] @@ -150,7 +150,7 @@ def test_tiles_factory(): assert endpoints.router_prefix == "/map" assert endpoints.with_common assert endpoints.title == "OGC Tiles API" - assert len(endpoints.router.routes) == 14 + assert len(endpoints.router.routes) == 15 app = FastAPI() app.include_router(endpoints.router, prefix="/map") @@ -160,7 +160,7 @@ def test_tiles_factory(): assert response.headers["content-type"] == "application/json" assert response.json()["title"] == "OGC Tiles API" links = response.json()["links"] - assert len(links) == 9 + assert len(links) == 10 landing_link = [link for link in links if link["title"] == "Landing Page"][0] assert landing_link["href"] == "http://testserver/map/" tms_link = [link for link in links if link["title"] == "TileMatrixSets"][0] @@ -180,7 +180,7 @@ def test_tiles_factory(): endpoints = OGCTilesFactory(title="OGC Tiles API", with_common=False) assert not endpoints.with_common assert endpoints.title == "OGC Tiles API" - assert len(endpoints.router.routes) == 12 + assert len(endpoints.router.routes) == 13 assert len(endpoints.conforms_to) == 5 app = FastAPI() @@ -203,7 +203,7 @@ def test_endpoints_factory(): endpoints = Endpoints() assert endpoints.with_common assert endpoints.title == "OGC API" - assert len(endpoints.router.routes) == 19 + assert len(endpoints.router.routes) == 20 assert len(endpoints.conforms_to) == 11 # 5 from tiles + 6 from features app = FastAPI() @@ -214,7 +214,7 @@ def test_endpoints_factory(): assert response.headers["content-type"] == "application/json" assert response.json()["title"] == "OGC API" links = response.json()["links"] - assert len(links) == 14 # 5 from tiles + 5 from features + 4 from common + assert len(links) == 15 # 6 from tiles + 5 from features + 4 from common landing_link = [link for link in links if link["title"] == "Landing Page"][0] assert landing_link["href"] == "http://testserver/" queryables_link = [ @@ -237,14 +237,14 @@ def test_endpoints_factory(): assert response.status_code == 200 assert response.headers["content-type"] == "application/json" body = response.json()["conformsTo"] - assert len(body) > 10 # 4 from tiles + 6 from features + assert len(body) > 9 # 3 from tiles + 6 from features assert "http://www.opengis.net/spec/ogcapi-common-1/1.0/conf/core" in body endpoints = Endpoints(router_prefix="/ogc", title="OGC Full API", with_common=True) assert endpoints.router_prefix == "/ogc" assert endpoints.with_common assert endpoints.title == "OGC Full API" - assert len(endpoints.router.routes) == 19 + assert len(endpoints.router.routes) == 20 assert not endpoints.ogc_features.with_common assert endpoints.ogc_features.router_prefix == "/ogc" assert not endpoints.ogc_tiles.with_common @@ -258,7 +258,7 @@ def test_endpoints_factory(): assert response.headers["content-type"] == "application/json" assert response.json()["title"] == "OGC Full API" links = response.json()["links"] - assert len(links) == 14 + assert len(links) == 15 landing_link = [link for link in links if link["title"] == "Landing Page"][0] assert landing_link["href"] == "http://testserver/ogc/" queryables_link = [ @@ -288,7 +288,7 @@ def test_endpoints_factory(): endpoints = Endpoints(title="Tiles and Features API", with_common=False) assert not endpoints.with_common assert endpoints.title == "Tiles and Features API" - assert len(endpoints.router.routes) == 17 # 10 from tiles + 5 from features + assert len(endpoints.router.routes) == 18 # 11 from tiles + 5 from features assert len(endpoints.conforms_to) == 11 # 4 from tiles + 6 from features app = FastAPI()