File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 55import jsonschema
66
77
8- class JsonSchemeValidator (Validator ):
8+ class JsonSchemaValidator (Validator ):
99 """JSON scheme validator."""
1010
11- def __init__ (self , scheme : Dict ):
11+ def __init__ (self , schema : Dict ):
1212 """
1313 Initialize JsonSchemeValidator.
1414
1515 Parameters
1616 ----------
17- scheme : Dict
17+ schema : Dict
1818 """
19- self .scheme = scheme
19+ self .schema = schema
2020
2121 def validate (self , data : Any ) -> None :
2222 """
23- Validate the data by JSON scheme .
23+ Validate the data by JSON schema .
2424
2525 Parameters
2626 ----------
@@ -31,6 +31,6 @@ def validate(self, data: Any) -> None:
3131 jeffy.validator.ValidationError
3232 """
3333 try :
34- jsonschema .validate (data , self .scheme )
34+ jsonschema .validate (data , self .schema )
3535 except jsonschema .ValidationError as e :
3636 raise ValidationError (e )
Original file line number Diff line number Diff line change 11from jeffy .validator import ValidationError
2- from jeffy .validator .jsonschema import JsonSchemeValidator
2+ from jeffy .validator .jsonschema import JsonSchemaValidator
33
44import pytest
55
66
77@pytest .fixture
88def jsonschema_validator ():
9- """Get JsonSchemeValidator class."""
10- return JsonSchemeValidator ( scheme = {
9+ """Get JsonSchemaValidator class."""
10+ return JsonSchemaValidator ( schema = {
1111 'type' : 'object' ,
1212 'properties' : {
1313 'message' : {'type' : 'string' }}})
1414
1515
16- class TestJsonSchemeValidator (object ):
16+ class TestJsonSchemaValidator (object ):
1717 """JSON scheme validator test."""
1818
1919 def test_validate (self , jsonschema_validator ):
You can’t perform that action at this time.
0 commit comments