def test_validate_boolean_failure(self): with self.assertRaises(config_validation.ValidationFail): config_validation.validate_key(config={'x': 'true'}, schema={'x': { 'type': 'boolean' }}, key='x')
def test_validate_revision_failure(self): with self.assertRaises(config_validation.ValidationFail): config_validation.validate_key(config={'x': 'abcdef'}, schema={'x': { 'type': 'revision' }}, key='x')
def test_validate_integer_failure(self): with self.assertRaises(config_validation.ValidationFail): config_validation.validate_key(config={'x': '123a'}, schema={'x': { 'type': 'integer' }}, key='x')
def test_validate_string_failure(self): with self.assertRaises(config_validation.ValidationFail): config_validation.validate_key(config={'x': 12345}, schema={'x': { 'type': 'string' }}, key='x')
def test_validate_choice_failure(self): with self.assertRaises(config_validation.ValidationFail): config_validation.validate_key( config={'x': 3}, schema={'x': { 'type': 'int', 'choices': [1, 2] }}, key='x')
def test_validate_required_value_is_none_fails(self): with self.assertRaises(config_validation.ValidationFail): config_validation.validate_key( config={'x': None}, schema={'x': { 'type': 'integer', 'required': True }}, key='x')
def test_validate_key_optional_value_is_none_passes(self): config_validation.validate_key( config={'x': None}, schema={'x': {'type': 'integer'}}, key='x')
def test_validate_choice_failure(self): with self.assertRaises(config_validation.ValidationFail): config_validation.validate_key( config={'x': 3}, schema={'x': {'type': 'int', 'choices': [1, 2]}}, key='x')
def test_validate_boolean_failure(self): with self.assertRaises(config_validation.ValidationFail): config_validation.validate_key( config={'x': 'true'}, schema={'x': {'type': 'boolean'}}, key='x')
def test_validate_revision_failure(self): with self.assertRaises(config_validation.ValidationFail): config_validation.validate_key( config={'x': 'abcdef'}, schema={'x': {'type': 'revision'}}, key='x')
def test_validate_required_value_is_none_fails(self): with self.assertRaises(config_validation.ValidationFail): config_validation.validate_key( config={'x': None}, schema={'x': {'type': 'integer', 'required': True}}, key='x')
def test_validate_integer_failure(self): with self.assertRaises(config_validation.ValidationFail): config_validation.validate_key( config={'x': '123a'}, schema={'x': {'type': 'integer'}}, key='x')
def test_validate_string_failure(self): with self.assertRaises(config_validation.ValidationFail): config_validation.validate_key( config={'x': 12345}, schema={'x': {'type': 'string'}}, key='x')