fix: normalize live verify peer filters
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was canceled

This commit is contained in:
lingniu
2026-06-29 21:04:24 +08:00
parent c99fa6cfb9
commit 33ae76fc1c
2 changed files with 28 additions and 3 deletions

View File

@@ -55,6 +55,24 @@ class VehicleIngestLiveVerifyTest(unittest.TestCase):
self.assertIn("ts >= '2026-06-29 00:00:00'", sql)
self.assertIn("ts <= '2026-06-29 23:59:59'", sql)
def test_gb32960_peer_filter_treats_plain_ip_as_contains_pattern(self):
sql = live_verify.gb32960_platform_login_count_sql(
date_from="2026-06-29 00:00:00",
date_to="2026-06-29 23:59:59",
peer_like="115.29.187.205",
)
self.assertIn("peer LIKE '%115.29.187.205%'", sql)
def test_gb32960_peer_filter_preserves_explicit_like_pattern(self):
sql = live_verify.gb32960_platform_login_count_sql(
date_from="2026-06-29 00:00:00",
date_to="2026-06-29 23:59:59",
peer_like="115.29.187.%",
)
self.assertIn("peer LIKE '115.29.187.%'", sql)
def test_jt808_location_sql_uses_dedicated_location_stable_without_protocol_filter(self):
sql = live_verify.jt808_location_count_sql(
date_from="2026-06-29 00:00:00",