Files
romm/backend/endpoints/tests/test_assets.py
Georges-Antoine Assi 7963e243dc Fix batch of test fixes
2024-01-17 10:26:37 -05:00

30 lines
796 B
Python

from fastapi.testclient import TestClient
from main import app
client = TestClient(app)
def test_delete_saves(access_token, save):
response = client.post(
"/saves/delete",
headers={"Authorization": f"Bearer {access_token}"},
json={"saves": [save.id], "delete_from_fs": False},
)
assert response.status_code == 200
body = response.json()
assert body['msg'] == "Successfully deleted 1 saves."
def test_delete_states(access_token, state):
response = client.post(
"/states/delete",
headers={"Authorization": f"Bearer {access_token}"},
json={"states": [state.id], "delete_from_fs": False},
)
assert response.status_code == 200
body = response.json()
assert body['msg'] == "Successfully deleted 1 states."