5151def test_TilerFactory ():
5252 """Test TilerFactory class."""
5353 cog = TilerFactory ()
54- assert len (cog .router .routes ) == 23
54+ assert len (cog .router .routes ) == 22
5555 assert len (cog .supported_tms .list ()) == NB_DEFAULT_TMS
5656
5757 cog = TilerFactory (router_prefix = "something" , supported_tms = WEB_TMS )
@@ -78,7 +78,7 @@ def test_TilerFactory():
7878 assert response .status_code == 422
7979
8080 cog = TilerFactory (add_preview = False , add_part = False , add_viewer = False )
81- assert len (cog .router .routes ) == 14
81+ assert len (cog .router .routes ) == 13
8282
8383 app = FastAPI ()
8484 cog = TilerFactory ()
@@ -314,12 +314,6 @@ def test_TilerFactory():
314314 root = ET .fromstring (response .content )
315315 assert root is not None
316316
317- response = client .get (f"/bounds?url={ DATA_DIR } /cog.tif" )
318- assert response .status_code == 200
319- assert response .headers ["content-type" ] == "application/json"
320- assert len (response .json ()["bounds" ]) == 4
321- assert response .json ()["crs" ]
322-
323317 response = client .get (f"/info?url={ DATA_DIR } /cog.tif" )
324318 assert response .status_code == 200
325319 assert response .headers ["content-type" ] == "application/json"
@@ -783,7 +777,7 @@ def test_MultiBaseTilerFactory(rio):
783777 rio .open = mock_rasterio_open
784778
785779 stac = MultiBaseTilerFactory (reader = STACReader )
786- assert len (stac .router .routes ) == 25
780+ assert len (stac .router .routes ) == 24
787781
788782 app = FastAPI ()
789783 app .include_router (stac .router )
@@ -802,11 +796,6 @@ def test_MultiBaseTilerFactory(rio):
802796 assert response .status_code == 200
803797 assert len (response .json ()) == 2
804798
805- response = client .get (f"/bounds?url={ DATA_DIR } /item.json" )
806- assert response .status_code == 200
807- assert len (response .json ()["bounds" ]) == 4
808- assert response .json ()["crs" ]
809-
810799 # no assets
811800 with pytest .warns (UserWarning ):
812801 response = client .get (f"/info?url={ DATA_DIR } /item.json" )
@@ -1173,7 +1162,7 @@ def test_MultiBandTilerFactory():
11731162 bands = MultiBandTilerFactory (
11741163 reader = BandFileReader , path_dependency = CustomPathParams
11751164 )
1176- assert len (bands .router .routes ) == 24
1165+ assert len (bands .router .routes ) == 23
11771166
11781167 app = FastAPI ()
11791168 app .include_router (bands .router )
@@ -1558,15 +1547,15 @@ def must_be_bob(credentials: security.HTTPBasicCredentials = Depends(http_basic)
15581547 route_dependencies = [
15591548 (
15601549 [
1561- {"path" : "/bounds " , "method" : "GET" },
1550+ {"path" : "/info " , "method" : "GET" },
15621551 {"path" : "/tiles/{tileMatrixSetId}/{z}/{x}/{y}" , "method" : "GET" },
15631552 ],
15641553 [Depends (must_be_bob )],
15651554 ),
15661555 ],
15671556 router_prefix = "something" ,
15681557 )
1569- assert len (cog .router .routes ) == 23
1558+ assert len (cog .router .routes ) == 22
15701559
15711560 app = FastAPI ()
15721561 app .include_router (cog .router , prefix = "/something" )
@@ -1582,14 +1571,10 @@ def must_be_bob(credentials: security.HTTPBasicCredentials = Depends(http_basic)
15821571 assert response .headers ["content-type" ] == "application/json"
15831572 assert response .json ()["tilejson" ]
15841573
1585- response = client .get (
1586- f"/something/bounds?url={ DATA_DIR } /cog.tif&rescale=0,1000" , auth = auth_bob
1587- )
1574+ response = client .get (f"/something/info?url={ DATA_DIR } /cog.tif" , auth = auth_bob )
15881575 assert response .status_code == 200
15891576
1590- response = client .get (
1591- f"/something/bounds?url={ DATA_DIR } /cog.tif&rescale=0,1000" , auth = auth_notbob
1592- )
1577+ response = client .get (f"/something/info?url={ DATA_DIR } /cog.tif" , auth = auth_notbob )
15931578 assert response .status_code == 401
15941579 assert response .json ()["detail" ] == "You're not Bob"
15951580
@@ -1615,7 +1600,7 @@ def must_be_bob(credentials: security.HTTPBasicCredentials = Depends(http_basic)
16151600
16161601 cog = TilerFactory (router_prefix = "something" )
16171602 cog .add_route_dependencies (
1618- scopes = [{"path" : "/bounds " , "method" : "GET" }],
1603+ scopes = [{"path" : "/info " , "method" : "GET" }],
16191604 dependencies = [Depends (must_be_bob )],
16201605 )
16211606
@@ -1630,14 +1615,10 @@ def must_be_bob(credentials: security.HTTPBasicCredentials = Depends(http_basic)
16301615 assert response .headers ["content-type" ] == "application/json"
16311616 assert response .json ()["tilejson" ]
16321617
1633- response = client .get (
1634- f"/something/bounds?url={ DATA_DIR } /cog.tif&rescale=0,1000" , auth = auth_bob
1635- )
1618+ response = client .get (f"/something/info?url={ DATA_DIR } /cog.tif" , auth = auth_bob )
16361619 assert response .status_code == 200
16371620
1638- response = client .get (
1639- f"/something/bounds?url={ DATA_DIR } /cog.tif&rescale=0,1000" , auth = auth_notbob
1640- )
1621+ response = client .get (f"/something/info?url={ DATA_DIR } /cog.tif" , auth = auth_notbob )
16411622 assert response .status_code == 401
16421623 assert response .json ()["detail" ] == "You're not Bob"
16431624
@@ -2088,7 +2069,7 @@ def test_ogc_maps_cog():
20882069 cog_path = f"{ DATA_DIR } /cog.tif"
20892070
20902071 cog = TilerFactory (add_ogc_maps = True )
2091- assert len (cog .router .routes ) == 24
2072+ assert len (cog .router .routes ) == 23
20922073
20932074 assert "https://www.opengis.net/spec/ogcapi-maps-1/1.0/conf/core" in cog .conforms_to
20942075
0 commit comments