Merge remote-tracking branch 'upstream/main' into reinlooptest

This commit is contained in:
rangang
2026-07-31 16:02:54 +08:00
23 changed files with 3109 additions and 2380 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ MODULE_PATH = Path(__file__).resolve().parents[1] / "core" / "data_collector.py"
def load_data_collector_module():
api = types.ModuleType("api")
api.base_url = "https://cloud.example"
api.data_record_url = "https://cloud.example/api"
api.data_record_url = "https://cloud.example"
api.the_folder = "customer-a/line-1"
requests = types.ModuleType("requests")
+2 -2
View File
@@ -30,12 +30,12 @@ class DeviceHeartbeatTests(unittest.TestCase):
requests_module.post = post
api_module = types.ModuleType("api")
api_module.data_record_url = "https://server.example/api"
api_module.data_record_url = "https://server.example"
api_module.the_folder = "company/line"
with patch.dict(sys.modules, {"requests": requests_module, "api": api_module}):
timestamp = HEARTBEAT.heartbeat_device(timeout=7)
self.assertEqual(timestamp, "2026-07-28T00:00:00.000Z")
self.assertEqual(calls, [("https://server.example/api", {
self.assertEqual(calls, [("https://server.example", {
"type": "deviceHeartbeat", "deviceId": "company/line"
}, 7)])