数据看板
This commit is contained in:
19
tests/test_data_dashboard_service.py
Normal file
19
tests/test_data_dashboard_service.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import unittest
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
from data_dashboard_service import list_runs
|
||||
|
||||
|
||||
class DataDashboardServiceTest(unittest.TestCase):
|
||||
@patch("data_dashboard_service._request")
|
||||
def test_list_runs_normalizes_single_run(self, request):
|
||||
response = Mock()
|
||||
response.json.return_value = {"ok": True, "run": {"id": "sqa_1", "status": "completed"}}
|
||||
request.return_value = response
|
||||
result = list_runs(task_id="sqa_1")
|
||||
self.assertEqual(result["total"], 1)
|
||||
self.assertEqual(result["items"][0]["id"], "sqa_1")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user