def test_match1(self): """ Match simple string. Positive test """ result_to_compare = "root" args = {"type": "string", "match": "root"} status, result = string_comparator.match("test-1", result_to_compare, args) self.assertTrue(status)
def test_match8(self): """ Match simple string. is_regex=true. Must fail """ result_to_compare = "root" args = {"type": "string", "match": "^t", "is_regex": True} status, result = string_comparator.match("test-2", result_to_compare, args) self.assertFalse(status)
def test_match4(self): """ Match simple string. Case insensitive match. Must fail """ result_to_compare = "RooT1" args = {"type": "string", "match": "root", "case_sensitive": False} status, result = string_comparator.match("test-2", result_to_compare, args) self.assertFalse(status)
def test_match6(self): """ Match simple string. exact_match=false. Must fail """ result_to_compare = "roots" args = {"type": "string", "match": "root", "exact_match": True} status, result = string_comparator.match("test-2", result_to_compare, args) self.assertFalse(status)
def test_match2(self): """ Match simple string. Negative test """ result_to_compare = "shadow" args = {"type": "string", "match": "root"} status, result = string_comparator.match("test-2", result_to_compare, args) self.assertFalse(status)