def testLocalMatcher(self): "Test the local: matcher against a series of known values." for ip, port, val, res in self.localMatcherValues: mo = matchers.LocalMatch('local:', val) hi = hinfo.frompairs((ip, port), ('0.0.0.0', '100')) self.assertEqual(mo.eval(hi), res)
def makehi(rip = '1.1.1.1', rport = 200, lip = '0.0.0.0', lport = 100): return hinfo.frompairs((lip, lport), (rip, rport))