Beispiel #1
0
    def test_should_validate_operation_object_no_responses(self):
        obj = {
            'description':
            'Returns all users',
            'parameters': [{
                'name': 'name',
                'description': 'Name to filter by',
                'type': 'string',
                'in': 'query'
            }]
        }

        with self.assertRaises(swagger.ValidationError):
            swagger.validate_operation_object(obj)
    def test_should_validate_operation_object_no_responses(self):
        obj = {
            'description': 'Returns all users',
            'parameters': [
                {
                    'name': 'name',
                    'description': 'Name to filter by',
                    'type': 'string',
                    'in': 'query'
                }
            ]
        }

        with self.assertRaises(swagger.ValidationError):
            swagger.validate_operation_object(obj)
Beispiel #3
0
 def test_should_validate_operation_object_invalid_field(self):
     with self.assertRaises(swagger.ValidationError):
         swagger.validate_operation_object({'some_invalid_field': 1})
 def test_should_validate_operation_object_invalid_field(self):
     with self.assertRaises(swagger.ValidationError):
         swagger.validate_operation_object({'some_invalid_field': 1})