init auth
This commit is contained in:
22
tests/test_api_protection.py
Normal file
22
tests/test_api_protection.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import pytest
|
||||
from fastapi.testclient import TestClient
|
||||
from main import app
|
||||
|
||||
client = TestClient(app)
|
||||
|
||||
def test_api_protection():
|
||||
# 1. Assets
|
||||
response = client.get("/api/assets")
|
||||
assert response.status_code == 401
|
||||
|
||||
# 2. Characters
|
||||
response = client.get("/api/characters")
|
||||
assert response.status_code == 401
|
||||
|
||||
# 3. Generations
|
||||
response = client.get("/api/generations")
|
||||
assert response.status_code == 401
|
||||
|
||||
# 4. Upload Asset (POST)
|
||||
response = client.post("/api/assets/upload")
|
||||
assert response.status_code == 401
|
||||
Reference in New Issue
Block a user