仿真数据接口契约。
| 106 | # --------------------------------------------------------------------------- |
| 107 | |
| 108 | class TestDataEndpoint: |
| 109 | """仿真数据接口契约。""" |
| 110 | |
| 111 | def test_returns_200(self, client): |
| 112 | resp = client.get("/api/data") |
| 113 | assert resp.status_code == 200 |
| 114 | |
| 115 | def test_response_is_json_object(self, client): |
| 116 | data = _json(client.get("/api/data")) |
| 117 | assert isinstance(data, dict) |
| 118 | |
| 119 | def test_response_contains_satellites(self, client): |
| 120 | data = _json(client.get("/api/data")) |
| 121 | assert "satellites" in data or "leo_satellites" in data or len(data) > 0 |
| 122 | |
| 123 | |
| 124 | # --------------------------------------------------------------------------- |
nothing calls this directly
no outgoing calls
no test coverage detected