'test that flow can get expired as time passes'

def test_remove_expired_entries(self):

    t = FlowTable()
    for (cookie, idle, hard) in ((1, 5, 20), (2, 5, 20), (3, 0, 20), (4, 0, 0)):
        t.add_entry(TableEntry(now=0, cookie=cookie, idle_timeout=idle, hard_timeout=hard))
    for (time, touch, remaining) in ((1, [], [1, 2, 3, 4]), (3, [2], [1, 2, 3, 4]), (6, [], [2, 3, 4]), (9, [], [3, 4]), (21, [], [4]), (99999999, [], [4])):
        [e.touch_packet(1, now=time) for e in t.entries if (e.cookie in touch)]
        t.remove_expired_entries(now=time)
        self.assertEqual(sorted([e.cookie for e in t.entries]), remaining)
