def test__regexp_csv_validator_invalid(): pattern_strings = ["test_.*", "foo\\.bar", "^baz)$"] with pytest.raises(sre_constants.error): config._regexp_csv_validator(None, None, ",".join(pattern_strings))
def test__regexp_csv_validator_valid(): pattern_strings = ["test_.*", "foo\\.bar", "^baz$"] result = config._regexp_csv_validator(None, None, ",".join(pattern_strings)) for i, regex in enumerate(result): assert isinstance(regex, re._pattern_type) assert regex.pattern == pattern_strings[i]
def test__regexp_csv_validator_valid(self): pattern_strings = ["test_.*", "foo\.bar", "^baz$"] result = config._regexp_csv_validator(None, None, ",".join(pattern_strings)) for i, regex in enumerate(result): self.assertTrue(isinstance(regex, re._pattern_type)) self.assertEqual(regex.pattern, pattern_strings[i])
def test__regexp_csv_validator_invalid(self): pattern_strings = ["test_.*", "foo\.bar", "^baz)$"] with self.assertRaises(sre_constants.error): config._regexp_csv_validator(None, None, ",".join(pattern_strings))
def test__regexp_csv_validator_valid(self): pattern_strings = ["test_.*", "foo\.bar", "^baz$"] result = config._regexp_csv_validator(None, None, ",".join(pattern_strings)) for i, regex in enumerate(result): self.assertTrue(isinstance(regex, re._pattern_type)) self.assertEqual(regex.pattern, pattern_strings[i])
def test__regexp_csv_validator_valid(): pattern_strings = ["test_.*", "foo\\.bar", "^baz$"] result = config._regexp_csv_validator(None, None, ",".join(pattern_strings)) for i, regex in enumerate(result): assert isinstance(regex, re._pattern_type) assert regex.pattern == pattern_strings[i]