@@ -97,6 +97,12 @@ def test_spec_not_detected(self, spec_invalid):
9797 with pytest .raises (SpecError ):
9898 unmarshal_apicall_request (request , spec = spec_invalid )
9999
100+ def test_spec_not_supported (self , spec_v20 ):
101+ request = mock .Mock (spec = Request )
102+
103+ with pytest .raises (SpecError ):
104+ unmarshal_apicall_request (request , spec = spec_v20 )
105+
100106 def test_request_type_invalid (self , spec_v31 ):
101107 request = mock .sentinel .request
102108
@@ -124,6 +130,12 @@ def test_spec_not_detected(self, spec_invalid):
124130 with pytest .raises (SpecError ):
125131 unmarshal_webhook_request (request , spec = spec_invalid )
126132
133+ def test_spec_not_supported (self , spec_v20 ):
134+ request = mock .Mock (spec = WebhookRequest )
135+
136+ with pytest .raises (SpecError ):
137+ unmarshal_webhook_request (request , spec = spec_v20 )
138+
127139 def test_request_type_invalid (self , spec_v31 ):
128140 request = mock .sentinel .request
129141
@@ -169,6 +181,12 @@ def test_spec_not_detected(self, spec_invalid):
169181 with pytest .raises (SpecError ):
170182 unmarshal_request (request , spec = spec_invalid )
171183
184+ def test_spec_not_supported (self , spec_v20 ):
185+ request = mock .Mock (spec = Request )
186+
187+ with pytest .raises (SpecError ):
188+ unmarshal_request (request , spec = spec_v20 )
189+
172190 def test_request_type_invalid (self , spec_v31 ):
173191 request = mock .sentinel .request
174192
@@ -257,6 +275,13 @@ def test_spec_not_detected(self, spec_invalid):
257275 with pytest .raises (SpecError ):
258276 unmarshal_apicall_response (request , response , spec = spec_invalid )
259277
278+ def test_spec_not_supported (self , spec_v20 ):
279+ request = mock .Mock (spec = Request )
280+ response = mock .Mock (spec = Response )
281+
282+ with pytest .raises (SpecError ):
283+ unmarshal_apicall_response (request , response , spec = spec_v20 )
284+
260285 def test_request_type_invalid (self , spec_v31 ):
261286 request = mock .sentinel .request
262287 response = mock .Mock (spec = Response )
@@ -297,6 +322,13 @@ def test_spec_not_detected(self, spec_invalid):
297322 with pytest .raises (SpecError ):
298323 unmarshal_response (request , response , spec = spec_invalid )
299324
325+ def test_spec_not_supported (self , spec_v20 ):
326+ request = mock .Mock (spec = Request )
327+ response = mock .Mock (spec = Response )
328+
329+ with pytest .raises (SpecError ):
330+ unmarshal_response (request , response , spec = spec_v20 )
331+
300332 def test_request_type_invalid (self , spec_v31 ):
301333 request = mock .sentinel .request
302334 response = mock .Mock (spec = Response )
@@ -404,6 +436,13 @@ def test_spec_not_detected(self, spec_invalid):
404436 with pytest .raises (SpecError ):
405437 unmarshal_webhook_response (request , response , spec = spec_invalid )
406438
439+ def test_spec_not_supported (self , spec_v20 ):
440+ request = mock .Mock (spec = WebhookRequest )
441+ response = mock .Mock (spec = Response )
442+
443+ with pytest .raises (SpecError ):
444+ unmarshal_webhook_response (request , response , spec = spec_v20 )
445+
407446 def test_request_type_invalid (self , spec_v31 ):
408447 request = mock .sentinel .request
409448 response = mock .Mock (spec = Response )
@@ -463,6 +502,12 @@ def test_spec_not_detected(self, spec_invalid):
463502 with pytest .raises (SpecError ):
464503 validate_apicall_request (request , spec = spec_invalid )
465504
505+ def test_spec_not_supported (self , spec_v20 ):
506+ request = mock .Mock (spec = Request )
507+
508+ with pytest .raises (SpecError ):
509+ validate_apicall_request (request , spec = spec_v20 )
510+
466511 def test_request_type_invalid (self , spec_v31 ):
467512 request = mock .sentinel .request
468513
@@ -502,6 +547,12 @@ def test_spec_not_detected(self, spec_invalid):
502547 with pytest .raises (SpecError ):
503548 validate_webhook_request (request , spec = spec_invalid )
504549
550+ def test_spec_not_supported (self , spec_v20 ):
551+ request = mock .Mock (spec = WebhookRequest )
552+
553+ with pytest .raises (SpecError ):
554+ validate_webhook_request (request , spec = spec_v20 )
555+
505556 def test_request_type_invalid (self , spec_v31 ):
506557 request = mock .sentinel .request
507558
@@ -548,6 +599,13 @@ def test_spec_not_detected(self, spec_invalid):
548599 with pytest .warns (DeprecationWarning ):
549600 validate_request (request , spec = spec_invalid )
550601
602+ def test_spec_not_detected (self , spec_v20 ):
603+ request = mock .Mock (spec = Request )
604+
605+ with pytest .raises (SpecError ):
606+ with pytest .warns (DeprecationWarning ):
607+ validate_request (request , spec = spec_v20 )
608+
551609 def test_request_type_invalid (self , spec_v31 ):
552610 request = mock .sentinel .request
553611
@@ -705,6 +763,13 @@ def test_spec_not_detected(self, spec_invalid):
705763 with pytest .raises (SpecError ):
706764 validate_apicall_response (request , response , spec = spec_invalid )
707765
766+ def test_spec_not_supported (self , spec_v20 ):
767+ request = mock .Mock (spec = Request )
768+ response = mock .Mock (spec = Response )
769+
770+ with pytest .raises (SpecError ):
771+ validate_apicall_response (request , response , spec = spec_v20 )
772+
708773 def test_request_type_invalid (self , spec_v31 ):
709774 request = mock .sentinel .request
710775 response = mock .Mock (spec = Response )
@@ -758,6 +823,13 @@ def test_spec_not_detected(self, spec_invalid):
758823 with pytest .raises (SpecError ):
759824 validate_webhook_response (request , response , spec = spec_invalid )
760825
826+ def test_spec_not_supported (self , spec_v20 ):
827+ request = mock .Mock (spec = WebhookRequest )
828+ response = mock .Mock (spec = Response )
829+
830+ with pytest .raises (SpecError ):
831+ validate_webhook_response (request , response , spec = spec_v20 )
832+
761833 def test_request_type_invalid (self , spec_v31 ):
762834 request = mock .sentinel .request
763835 response = mock .Mock (spec = Response )
@@ -819,6 +891,14 @@ def test_spec_not_detected(self, spec_invalid):
819891 with pytest .warns (DeprecationWarning ):
820892 validate_response (request , response , spec = spec_invalid )
821893
894+ def test_spec_not_supported (self , spec_v20 ):
895+ request = mock .Mock (spec = Request )
896+ response = mock .Mock (spec = Response )
897+
898+ with pytest .raises (SpecError ):
899+ with pytest .warns (DeprecationWarning ):
900+ validate_response (request , response , spec = spec_v20 )
901+
822902 def test_request_type_invalid (self , spec_v31 ):
823903 request = mock .sentinel .request
824904 response = mock .Mock (spec = Response )
0 commit comments