20 lines
538 B
Python
20 lines
538 B
Python
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)
|