Files
romm/backend/endpoints/tests/test_assets.py
Georges-Antoine Assi 880345f20c ruff-only pre-commit
2024-05-18 12:05:57 -04:00

30 lines
794 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"