

def test_tripboard_over_midnight(self):
    sc = ServiceCalendar()
    sc.add_period(0, ((1 * 3600) * 24), ['WKDY'])
    sc.add_period(((1 * 3600) * 24), ((2 * 3600) * 24), ['SAT'])
    tz = Timezone()
    tz.add_period(TimezonePeriod(0, ((2 * 3600) * 24), 0))
    hb = HeadwayBoard('WKDY', sc, tz, 0, 'owl', (23 * 3600), (26 * 3600), 100)
    s0 = State(1, 0)
    s1 = s1.walk(s0, WalkOptions())
    assert (s1.weight == 82901)
    assert (s1.service_period(0).service_ids == [0])
    s0 = State(1, (23 * 3600))
    s1 = hb.walk(s0, WalkOptions())
    assert (s1.weight == 101)
    assert (s1.service_period(0).service_ids == [0])
    s0 = State(1, (24 * 3600))
    s1 = hb.walk(s0, WalkOptions())
    assert (s1.weight == 101)
    assert (s1.service_period(0).service_ids == [1])
    s0 = State(1, (25 * 3600))
    s1 = hb.walk(s0, WalkOptions())
    assert (s1.time == ((25 * 3600) + 100))
    assert (s1.weight == 101)
    assert (s1.service_period(0).service_ids == [1])
    s0 = State(1, (26 * 3600))
    s1 = hb.walk(s0, WalkOptions())
    assert (s1.time == ((26 * 3600) + 100))
    assert (s1.weight == 101)
    assert (s1.service_period(0).service_ids == [1])
    s0 = State(1, ((26 * 3600) + 1))
    s1 = hb.walk(s0, WalkOptions())
    assert (s1 == None)

dataset/ETHPy150Open bmander/graphserver/pygs/test/unit_test/test_headwayboard.py TestHeadwayBoard.test_tripboard_over_midnight/VarMisuse@134/166 `hb`->`s1`