remove /api support

This commit is contained in:
2026-07-31 14:19:48 +08:00
parent 46c69607c5
commit 6330b99860
11 changed files with 75 additions and 67 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)])