for sv, tv, v in values:
self.assertEquals(QueryProcessor.match_cidr(sv, tv), v)
+ def testMatchValue(self):
+ values = [ ("foo", "foobar", False), ("foo*", "foobar", True),
+ ("*bar", "foobar", True), ("*bar", "foobara", False),
+ ("127.0.0.0/24*", "127.0/8", True) ]
+ for sv, tv, v in values:
+ self.assertEquals(QueryProcessor.match_value(sv, tv), v)
+
+ def testMatchValues(self):
+ values = [ "bar", "127.0.0.1/32", "foobar", "fbar" ]
+ assert(QueryProcessor.match_values("foo*", values))
+ assert(QueryProcessor.match_values("127.0.0.0/24**", values))
+ assert(not QueryProcessor.match_values("*bart", values))
+
def testIsDomainName(self):
values = [ ("a.domain", True), ("not_a_domain", False),
("www.foo.com.", True), ("glor!.com", False),