MCPcopy Create free account
hub / github.com/Tong89/smartNode / TestDataCombinationsEndpoint

Class TestDataCombinationsEndpoint

tests/test_api_integration.py:528–553  ·  view source on GitHub ↗

数据组合信息接口契约。

Source from the content-addressed store, hash-verified

526# ---------------------------------------------------------------------------
527
528class TestDataCombinationsEndpoint:
529 """数据组合信息接口契约。"""
530
531 def test_returns_200(self, client):
532 resp = client.get("/api/data_combinations")
533 assert resp.status_code == 200
534
535 def test_response_has_base_types(self, client):
536 data = _json(client.get("/api/data_combinations"))
537 assert "base_types" in data
538 assert isinstance(data["base_types"], list)
539 assert len(data["base_types"]) > 0
540
541 def test_response_has_total_combinations(self, client):
542 data = _json(client.get("/api/data_combinations"))
543 assert "total_combinations" in data
544 assert isinstance(data["total_combinations"], int)
545 assert data["total_combinations"] > 0
546
547 def test_base_types_contain_known_types(self, client):
548 data = _json(client.get("/api/data_combinations"))
549 base_types = set(data["base_types"])
550 expected = {"TASK_CMD", "INTEL", "DATA_SLICE", "RAW_IMAGE"}
551 assert expected.issubset(base_types), (
552 f"base_types 应至少包含 {expected},实际: {base_types}"
553 )
554
555
556# ---------------------------------------------------------------------------

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected