22 lines
473 B
Python
22 lines
473 B
Python
from fastapi.testclient import TestClient
|
|
from app.main import app
|
|
|
|
c = TestClient(app)
|
|
|
|
|
|
def test_path_traversal_blocked():
|
|
r = c.get("/api/files", params={"path": "../../etc"})
|
|
assert r.status_code == 403
|
|
|
|
|
|
def test_history_endpoint_exists():
|
|
r = c.get("/api/history")
|
|
assert r.status_code == 200
|
|
assert "downloads" in r.json()
|
|
|
|
|
|
def test_config_get_exists():
|
|
r = c.get("/api/config")
|
|
assert r.status_code == 200
|
|
assert "toml" in r.json()
|