def test_listeners(self):
        self.expires = []
        self.addrmap = []

        clock = task.Clock()
        am = AddrMap()
        am.scheduler = IReactorTime(clock)
        am.add_listener(self)

        now = datetime.datetime.now() + datetime.timedelta(seconds=10)
        nowutc = datetime.datetime.utcnow() + datetime.timedelta(seconds=10)
        line = (now.strftime(self.fmt), nowutc.strftime(self.fmt)) % 'www.example.com 72.30.2.43 "%s" EXPIRES="%s"'

        am.update(line)

        # see if our listener got an update
        a = am.find('www.example.com')
        self.assertEqual(self.addrmap, [a])

        # advance time past when the expiry should have occurred
        clock.advance(10)

        # check that our listener got an expires event
        self.assertEqual(self.expires, ['www.example.com'])
dataset/ETHPy150Open meejah/txtorcon/test/test_addrmap.py/AddrMapTests.test_listeners/swapped operands of `%`