feat: 验收任务周期采集与设备资源接口
- 新增 acceptance-tasks 周期采集、立即采集、断点续采与批次管理 - acceptance-resources 返回 xhs_device_accounts 真实设备清单 - 数据看板服务调整及测试更新
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import unittest
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
from ocr_dashboard_service import export_evidences, get_summary, list_batches, list_results
|
||||
from ocr_dashboard_service import export_evidences, get_comparison, get_summary, list_batches, list_results
|
||||
from task_service import TaskError
|
||||
|
||||
|
||||
@@ -21,6 +21,23 @@ class OcrDashboardServiceTest(unittest.TestCase):
|
||||
get_summary("b1", "c1")
|
||||
self.assertEqual(get.call_args.kwargs["params"], {"batch_key": "b1", "collection_key": "c1"})
|
||||
|
||||
@patch("ocr_dashboard_service.SESSION.get")
|
||||
def test_comparison_forwards_scope(self, get):
|
||||
response = Mock()
|
||||
response.json.return_value = {
|
||||
"success": True, "code": 200,
|
||||
"data": {"current": {}, "previous": {}},
|
||||
}
|
||||
get.return_value = response
|
||||
|
||||
result = get_comparison("b1", "c1")
|
||||
|
||||
self.assertIn("current", result)
|
||||
self.assertEqual(
|
||||
get.call_args.kwargs["params"],
|
||||
{"batch_key": "b1", "collection_key": "c1"},
|
||||
)
|
||||
|
||||
def test_results_rejects_oversized_page(self):
|
||||
with self.assertRaises(TaskError):
|
||||
list_results({"page_size": "201"})
|
||||
|
||||
Reference in New Issue
Block a user