def test_expires_old(self):
        """
        Test something that expires before "now"
        """

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

        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)
        self.assertTrue('www.example.com' in am.addr)
        # arguably we shouldn't even have put this in the map maybe,
        # but the reactor needs to iterate before our expiry callback
        # gets called (right away) which is simulated by the
        # clock.advance call
        clock.advance(0)
        self.assertTrue('www.example.com' not in am.addr)
dataset/ETHPy150Open meejah/txtorcon/test/test_addrmap.py/AddrMapTests.test_expires_old/swapped operands of `%`