Skip to content

Commit ca1cbe7

Browse files
committed
Check /all-storages in backend tests
1 parent 74c1a53 commit ca1cbe7

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

backend/test/test_org.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,10 @@ def test_add_custom_storage_doesnt_verify(admin_auth_headers):
261261
},
262262
)
263263
assert r.status_code == 400
264-
assert r.json()["detail"] == "Could not verify custom storage. Check credentials are valid?"
264+
assert (
265+
r.json()["detail"]
266+
== "Could not verify custom storage. Check credentials are valid?"
267+
)
265268

266269

267270
def test_add_custom_storage(admin_auth_headers):
@@ -298,6 +301,16 @@ def test_add_custom_storage(admin_auth_headers):
298301
assert data["added"]
299302
assert data["name"] == CUSTOM_REPLICA_STORAGE_NAME
300303

304+
# verify custom storages are now available on org
305+
r = requests.get(
306+
f"{API_PREFIX}/orgs/{new_oid}/all-storages",
307+
headers=admin_auth_headers,
308+
)
309+
assert r.status_code == 200
310+
all_storages = r.json()["allStorages"]
311+
assert {"name": CUSTOM_PRIMARY_STORAGE_NAME, "custom": True} in all_storages
312+
assert {"name": CUSTOM_REPLICA_STORAGE_NAME, "custom": True} in all_storages
313+
301314
# set org to use custom storage moving forward
302315
r = requests.post(
303316
f"{API_PREFIX}/orgs/{new_oid}/storage",

0 commit comments

Comments
 (0)