@@ -122,14 +122,14 @@ def add_test_methods(test_class):
122122class TypesMixin (object ):
123123 @unittest .skipIf (PY3 , "In Python 3 json.load always produces unicode" )
124124 def test_string_a_bytestring_is_a_string (self ):
125- self .validator_class ({"type" : "string" }).validate (b"foo" )
125+ self .validator_class ({"type" : "string" }).validate (b"foo" )
126126
127127
128128class DecimalMixin (object ):
129129 def test_it_can_validate_with_decimals (self ):
130- schema = {"type" : "number" }
130+ schema = {"type" : "number" }
131131 validator = self .validator_class (
132- schema , types = {"number" : (int , float , Decimal )}
132+ schema , types = {"number" : (int , float , Decimal )}
133133 )
134134
135135 for valid in [1 , 1.1 , Decimal (1 ) / Decimal (8 )]:
@@ -158,7 +158,7 @@ def missing_format(case, test):
158158class FormatMixin (object ):
159159 def test_it_returns_true_for_formats_it_does_not_know_about (self ):
160160 validator = self .validator_class (
161- {"format" : "carrot" }, format_checker = FormatChecker (),
161+ {"format" : "carrot" }, format_checker = FormatChecker (),
162162 )
163163 validator .validate ("bugs" )
164164
@@ -169,7 +169,7 @@ def test_it_does_not_validate_formats_by_default(self):
169169 def test_it_validates_formats_if_a_checker_is_provided (self ):
170170 checker = mock .Mock (spec = FormatChecker )
171171 validator = self .validator_class (
172- {"format" : "foo" }, format_checker = checker ,
172+ {"format" : "foo" }, format_checker = checker ,
173173 )
174174
175175 validator .validate ("bar" )
@@ -187,7 +187,7 @@ def test_it_validates_formats_if_a_checker_is_provided(self):
187187 def test_it_validates_formats_of_any_type (self ):
188188 checker = mock .Mock (spec = FormatChecker )
189189 validator = self .validator_class (
190- {"format" : "foo" }, format_checker = checker ,
190+ {"format" : "foo" }, format_checker = checker ,
191191 )
192192
193193 validator .validate ([1 , 2 , 3 ])
@@ -224,10 +224,10 @@ def narrow_unicode_build(case, test): # This isn't, skip nothing.
224224@load_json_cases ("draft3/optional/zeroTerminatedFloats.json" )
225225class TestDraft3 (unittest .TestCase , TypesMixin , DecimalMixin , FormatMixin ):
226226 validator_class = Draft3Validator
227- validator_kwargs = {"format_checker" : draft3_format_checker }
227+ validator_kwargs = {"format_checker" : draft3_format_checker }
228228
229229 def test_any_type_is_valid_for_type_any (self ):
230- validator = self .validator_class ({"type" : "any" })
230+ validator = self .validator_class ({"type" : "any" })
231231 validator .validate (mock .Mock ())
232232
233233 # TODO: we're in need of more meta schema tests
@@ -239,7 +239,7 @@ def test_invalid_properties(self):
239239 def test_minItems_invalid_string (self ):
240240 with self .assertRaises (SchemaError ):
241241 # needs to be an integer
242- validate ([1 ], {"minItems" : "1" }, cls = self .validator_class )
242+ validate ([1 ], {"minItems" : "1" }, cls = self .validator_class )
243243
244244
245245@load_json_cases (
@@ -254,7 +254,7 @@ def test_minItems_invalid_string(self):
254254@load_json_cases ("draft4/optional/zeroTerminatedFloats.json" )
255255class TestDraft4 (unittest .TestCase , TypesMixin , DecimalMixin , FormatMixin ):
256256 validator_class = Draft4Validator
257- validator_kwargs = {"format_checker" : draft4_format_checker }
257+ validator_kwargs = {"format_checker" : draft4_format_checker }
258258
259259 # TODO: we're in need of more meta schema tests
260260 def test_invalid_properties (self ):
@@ -265,7 +265,7 @@ def test_invalid_properties(self):
265265 def test_minItems_invalid_string (self ):
266266 with self .assertRaises (SchemaError ):
267267 # needs to be an integer
268- validate ([1 ], {"minItems" : "1" }, cls = self .validator_class )
268+ validate ([1 ], {"minItems" : "1" }, cls = self .validator_class )
269269
270270
271271class RemoteRefResolutionMixin (object ):
@@ -277,7 +277,7 @@ def setUp(self):
277277
278278 def resolve (self , reference ):
279279 _ , _ , reference = reference .partition ("http://localhost:1234/" )
280- return mock .Mock (** {"json.return_value" : REMOTES .get (reference )})
280+ return mock .Mock (** {"json.return_value" : REMOTES .get (reference )})
281281
282282
283283@load_json_cases ("draft3/refRemote.json" )
0 commit comments