sicherheitsupdate
This commit is contained in:
19
tests/test_api.py
Normal file
19
tests/test_api.py
Normal file
@ -0,0 +1,19 @@
|
||||
from fastapi.testclient import TestClient
|
||||
from wilcon import app
|
||||
|
||||
client = TestClient(app)
|
||||
|
||||
def test_sysinfo_endpoint():
|
||||
response = client.get("/sysinfo")
|
||||
assert response.status_code == 200
|
||||
assert "cpu" in response.json()
|
||||
|
||||
def test_netinfo_endpoint():
|
||||
response = client.get("/netinfo")
|
||||
assert response.status_code == 200
|
||||
assert "ip_address" in response.json()
|
||||
|
||||
def test_procinfo_endpoint():
|
||||
response = client.get("/procinfo")
|
||||
assert response.status_code == 200
|
||||
assert isinstance(response.json(), list)
|
||||
Reference in New Issue
Block a user