import unittest
from starter import normalize, service_band
class StartingChecks(unittest.TestCase):
    def test_a_utc(self):
        r=dict(event_id='E1',order_ref='O1',hub='海港',service='express',event='created',event_time='2026-09-01T10:00:00+10:00')
        self.assertEqual(normalize(r,'A')['happened_at'],'2026-09-01T00:00:00Z')
    def test_b_epoch(self):
        r=dict(id='E1',shipment=dict(number='O1',station='海港',product='express'),action='OPEN',at_ms=0)
        self.assertEqual(normalize(r,'B')['happened_at'],'1970-01-01T00:00:00Z')
    def test_small_sample_first(self):
        rules=dict(min_sample=15,late_target=.1,review_gap_pp=5,priority_gap_pp=15)
        self.assertEqual(service_band(.9,4,rules),'待补样本')
if __name__=='__main__':unittest.main()
