Example #1
0
    def test_should_validate_response_object_no_description(self):
        obj = {
            'examples': {
                'application/json': [{
                    'id': 1,
                    'name': 'somebody'
                }]
            }
        }

        with self.assertRaises(swagger.ValidationError):
            swagger.validate_response_object(obj)
    def test_should_validate_response_object_no_description(self):
        obj = {
            'examples': {
                'application/json': [
                    {
                        'id': 1,
                        'name': 'somebody'
                    }
                ]
            }
        }

        with self.assertRaises(swagger.ValidationError):
            swagger.validate_response_object(obj)
Example #3
0
 def test_should_validate_response_object_invalid_field(self):
     with self.assertRaises(swagger.ValidationError):
         swagger.validate_response_object({'some_invalid_field': 1})
 def test_should_validate_response_object_invalid_field(self):
     with self.assertRaises(swagger.ValidationError):
         swagger.validate_response_object({'some_invalid_field': 1})