@@ -284,90 +284,6 @@ def test_required(self, validator_class):
284284 validator .validate ({"another_prop" : "bla" })
285285 assert validator .validate ({"some_prop" : "hello" }) is None
286286
287- def test_read_only (self , validator_class ):
288- schema = {
289- "type" : "object" ,
290- "properties" : {"some_prop" : {"type" : "string" , "readOnly" : True }},
291- }
292-
293- with pytest .warns (DeprecationWarning ):
294- validator = validator_class (
295- schema , format_checker = oas30_format_checker , write = True
296- )
297- with pytest .raises (
298- ValidationError ,
299- match = "Tried to write read-only property with hello" ,
300- ):
301- validator .validate ({"some_prop" : "hello" })
302- with pytest .warns (DeprecationWarning ):
303- validator = validator_class (
304- schema , format_checker = oas30_format_checker , read = True
305- )
306- assert validator .validate ({"some_prop" : "hello" }) is None
307-
308- def test_write_only (self , validator_class ):
309- schema = {
310- "type" : "object" ,
311- "properties" : {"some_prop" : {"type" : "string" , "writeOnly" : True }},
312- }
313-
314- with pytest .warns (DeprecationWarning ):
315- validator = validator_class (
316- schema , format_checker = oas30_format_checker , read = True
317- )
318- with pytest .raises (
319- ValidationError ,
320- match = "Tried to read write-only property with hello" ,
321- ):
322- validator .validate ({"some_prop" : "hello" })
323- with pytest .warns (DeprecationWarning ):
324- validator = validator_class (
325- schema , format_checker = oas30_format_checker , write = True
326- )
327- assert validator .validate ({"some_prop" : "hello" }) is None
328-
329- def test_required_read_only (self , validator_class ):
330- schema = {
331- "type" : "object" ,
332- "properties" : {"some_prop" : {"type" : "string" , "readOnly" : True }},
333- "required" : ["some_prop" ],
334- }
335-
336- with pytest .warns (DeprecationWarning ):
337- validator = validator_class (
338- schema , format_checker = oas30_format_checker , read = True
339- )
340- with pytest .raises (
341- ValidationError , match = "'some_prop' is a required property"
342- ):
343- validator .validate ({"another_prop" : "hello" })
344- with pytest .warns (DeprecationWarning ):
345- validator = validator_class (
346- schema , format_checker = oas30_format_checker , write = True
347- )
348- assert validator .validate ({"another_prop" : "hello" }) is None
349-
350- def test_required_write_only (self , validator_class ):
351- schema = {
352- "type" : "object" ,
353- "properties" : {"some_prop" : {"type" : "string" , "writeOnly" : True }},
354- "required" : ["some_prop" ],
355- }
356-
357- with pytest .warns (DeprecationWarning ):
358- validator = validator_class (
359- schema , format_checker = oas30_format_checker , write = True
360- )
361- with pytest .raises (
362- ValidationError , match = "'some_prop' is a required property"
363- ):
364- validator .validate ({"another_prop" : "hello" })
365- with pytest .warns (DeprecationWarning ):
366- validator = validator_class (
367- schema , format_checker = oas30_format_checker , read = True
368- )
369- assert validator .validate ({"another_prop" : "hello" }) is None
370-
371287 def test_oneof_required (self , validator_class ):
372288 instance = {
373289 "n3IwfId" : "string" ,
0 commit comments