|
69 | 69 |
|
70 | 70 |
|
71 | 71 | async def test_default_app_no_transactions( |
72 | | - default_app_client, load_test_data, load_test_collection |
| 72 | + app_client_no_transaction, load_test_data, load_test_collection |
73 | 73 | ): |
74 | 74 | coll = load_test_collection |
75 | 75 | item = load_test_data("test_item.json") |
76 | | - resp = await default_app_client.post(f"/collections/{coll['id']}/items", json=item) |
| 76 | + resp = await app_client_no_transaction.post( |
| 77 | + f"/collections/{coll['id']}/items", json=item |
| 78 | + ) |
77 | 79 |
|
78 | 80 | # the default application does not have the transaction extensions enabled! |
79 | 81 | assert resp.status_code == 405 |
@@ -903,3 +905,40 @@ async def test_no_extension( |
903 | 905 |
|
904 | 906 | finally: |
905 | 907 | await close_db_connection(app) |
| 908 | + |
| 909 | + |
| 910 | +async def test_default_app(default_client, default_app, load_test_data): |
| 911 | + api_routes = { |
| 912 | + f"{list(route.methods)[0]} {route.path}" for route in default_app.routes |
| 913 | + } |
| 914 | + assert set(STAC_CORE_ROUTES).issubset(api_routes) |
| 915 | + assert set(STAC_TRANSACTION_ROUTES).issubset(api_routes) |
| 916 | + |
| 917 | + # Load collections |
| 918 | + col = load_test_data("test_collection.json") |
| 919 | + resp = await default_client.post("/collections", json=col) |
| 920 | + assert resp.status_code == 201 |
| 921 | + |
| 922 | + # Load items |
| 923 | + item = load_test_data("test_item.json") |
| 924 | + resp = await default_client.post(f"/collections/{col['id']}/items", json=item) |
| 925 | + assert resp.status_code == 201 |
| 926 | + |
| 927 | + resp = await default_client.get("/conformance") |
| 928 | + assert resp.status_code == 200 |
| 929 | + conf = resp.json()["conformsTo"] |
| 930 | + assert ( |
| 931 | + "https://api.stacspec.org/v1.0.0/ogcapi-features/extensions/transaction" in conf |
| 932 | + ) |
| 933 | + assert "https://api.stacspec.org/v1.0.0/collections/extensions/transaction" in conf |
| 934 | + assert "http://www.opengis.net/spec/cql2/1.0/conf/basic-cql2" in conf |
| 935 | + assert "http://www.opengis.net/spec/ogcapi-common-2/1.0/conf/simple-query" in conf |
| 936 | + assert "http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/core" in conf |
| 937 | + assert ( |
| 938 | + "http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/features-filter" in conf |
| 939 | + ) |
| 940 | + assert "http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/filter" in conf |
| 941 | + assert "https://api.stacspec.org/v1.0.0-rc.1/collection-search" in conf |
| 942 | + assert "https://api.stacspec.org/v1.0.0/collections" in conf |
| 943 | + assert "https://api.stacspec.org/v1.0.0/ogcapi-features#query" in conf |
| 944 | + assert "https://api.stacspec.org/v1.0.0/ogcapi-features#sort" in conf |
0 commit comments