def test__regexp_validator_invalid(): with pytest.raises(sre_constants.error): config._regexp_validator(None, None, "test_)")
def test__regexp_validator_valid(): result = config._regexp_validator(None, None, "test_.*") assert isinstance(result, re._pattern_type) assert result.pattern == "test_.*"
def test__regexp_validator_invalid(self): with self.assertRaises(sre_constants.error): config._regexp_validator(None, None, "test_)")
def test__regexp_validator_valid(self): result = config._regexp_validator(None, None, "test_.*") self.assertTrue(isinstance(result, re._pattern_type)) self.assertEqual(result.pattern, "test_.*")
def test__regexp_validator_valid(): result = config._regexp_validator(None, None, "test_.*") assert isinstance(result, RE_PATTERN_TYPE) assert result.pattern == "test_.*"