Skip to content

Commit d161d4c

Browse files
committed
fix typo class name of JsonSchemaValidator
1 parent cda8a42 commit d161d4c

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

jeffy/validator/jsonschema.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55
import 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)

tests/jeffy/validator/test_jsonschema.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
from jeffy.validator import ValidationError
2-
from jeffy.validator.jsonschema import JsonSchemeValidator
2+
from jeffy.validator.jsonschema import JsonSchemaValidator
33

44
import pytest
55

66

77
@pytest.fixture
88
def 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):

0 commit comments

Comments
 (0)