test_api.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import pytest
  2. from fastapi.testclient import TestClient
  3. from api.routes import app
  4. @pytest.fixture
  5. def client():
  6. return TestClient(app)
  7. class TestAPIEndpoints:
  8. def test_get_status(self, client):
  9. pass
  10. # response = client.get("/status")
  11. # assert response.status_code == 200
  12. # assert "status" in response.json()
  13. def test_get_robot_position(self, client):
  14. pass
  15. # response = client.get("/robot/position")
  16. # assert response.status_code == 200
  17. # data = response.json()
  18. # assert "x" in data
  19. # assert "y" in data
  20. # assert "z" in data
  21. def test_get_slots_status(self, client):
  22. pass
  23. # response = client.get("/slots")
  24. # assert response.status_code == 200
  25. # slots = response.json()
  26. # assert isinstance(slots, list)
  27. # if len(slots) > 0:
  28. # assert "id" in slots[0]
  29. # assert "occupied" in slots[0]
  30. def test_emergency_stop(self, client):
  31. pass
  32. # response = client.post("/robot/stop")
  33. # assert response.status_code == 200
  34. # assert response.json()["status"] == "stopped"