def test_oas_20_invalid(self):
     with pytest.raises(schemas.SchemaValidationError) as excinfo:
         schemas.validate(
             {"swagger": "2.0", "should": "not be here",}
         )
     for error in excinfo.value.errors:
         assert isinstance(error, ValidationError)
Beispiel #2
0
 def test_oas_20_invalid(self):
     with pytest.raises(schemas.SchemaValidationError) as excinfo:
         schemas.validate({
             'swagger': '2.0',
             'should': 'not be here',
         })
     for error in excinfo.value.errors:
         assert isinstance(error, ValidationError)
 def test_oas_20_valid(self):
     assert schemas.validate(
         {
             "swagger": "2.0",
             "info": {"title": "An empty minimal specification", "version": "1.0",},
             "paths": {},
         }
     )
Beispiel #4
0
 def test_oas_20_valid(self):
     assert schemas.validate({
         'swagger': '2.0',
         'info': {
             'title': 'An empty minimal specification',
             'version': '1.0',
         },
         'paths': {},
     })
 def test_unknown_version(self):
     with pytest.raises(errors.SpecsError):
         schemas.validate({"swagger": "42.0"})
 def test_unknown_schema(self):
     with pytest.raises(errors.SpecsError):
         schemas.validate({"valid": "no"})
Beispiel #7
0
 def test_unknown_version(self):
     with pytest.raises(errors.SpecsError):
         schemas.validate({'swagger': '42.0'})
Beispiel #8
0
 def test_unknown_schema(self):
     with pytest.raises(errors.SpecsError):
         schemas.validate({'valid': 'no'})