@@ -97,6 +97,12 @@ def test_spec_not_detected(self, spec_invalid):
97
97
with pytest .raises (SpecError ):
98
98
unmarshal_apicall_request (request , spec = spec_invalid )
99
99
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
+
100
106
def test_request_type_invalid (self , spec_v31 ):
101
107
request = mock .sentinel .request
102
108
@@ -124,6 +130,12 @@ def test_spec_not_detected(self, spec_invalid):
124
130
with pytest .raises (SpecError ):
125
131
unmarshal_webhook_request (request , spec = spec_invalid )
126
132
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
+
127
139
def test_request_type_invalid (self , spec_v31 ):
128
140
request = mock .sentinel .request
129
141
@@ -169,6 +181,12 @@ def test_spec_not_detected(self, spec_invalid):
169
181
with pytest .raises (SpecError ):
170
182
unmarshal_request (request , spec = spec_invalid )
171
183
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
+
172
190
def test_request_type_invalid (self , spec_v31 ):
173
191
request = mock .sentinel .request
174
192
@@ -257,6 +275,13 @@ def test_spec_not_detected(self, spec_invalid):
257
275
with pytest .raises (SpecError ):
258
276
unmarshal_apicall_response (request , response , spec = spec_invalid )
259
277
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
+
260
285
def test_request_type_invalid (self , spec_v31 ):
261
286
request = mock .sentinel .request
262
287
response = mock .Mock (spec = Response )
@@ -297,6 +322,13 @@ def test_spec_not_detected(self, spec_invalid):
297
322
with pytest .raises (SpecError ):
298
323
unmarshal_response (request , response , spec = spec_invalid )
299
324
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
+
300
332
def test_request_type_invalid (self , spec_v31 ):
301
333
request = mock .sentinel .request
302
334
response = mock .Mock (spec = Response )
@@ -404,6 +436,13 @@ def test_spec_not_detected(self, spec_invalid):
404
436
with pytest .raises (SpecError ):
405
437
unmarshal_webhook_response (request , response , spec = spec_invalid )
406
438
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
+
407
446
def test_request_type_invalid (self , spec_v31 ):
408
447
request = mock .sentinel .request
409
448
response = mock .Mock (spec = Response )
@@ -463,6 +502,12 @@ def test_spec_not_detected(self, spec_invalid):
463
502
with pytest .raises (SpecError ):
464
503
validate_apicall_request (request , spec = spec_invalid )
465
504
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
+
466
511
def test_request_type_invalid (self , spec_v31 ):
467
512
request = mock .sentinel .request
468
513
@@ -502,6 +547,12 @@ def test_spec_not_detected(self, spec_invalid):
502
547
with pytest .raises (SpecError ):
503
548
validate_webhook_request (request , spec = spec_invalid )
504
549
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
+
505
556
def test_request_type_invalid (self , spec_v31 ):
506
557
request = mock .sentinel .request
507
558
@@ -548,6 +599,13 @@ def test_spec_not_detected(self, spec_invalid):
548
599
with pytest .warns (DeprecationWarning ):
549
600
validate_request (request , spec = spec_invalid )
550
601
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
+
551
609
def test_request_type_invalid (self , spec_v31 ):
552
610
request = mock .sentinel .request
553
611
@@ -705,6 +763,13 @@ def test_spec_not_detected(self, spec_invalid):
705
763
with pytest .raises (SpecError ):
706
764
validate_apicall_response (request , response , spec = spec_invalid )
707
765
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
+
708
773
def test_request_type_invalid (self , spec_v31 ):
709
774
request = mock .sentinel .request
710
775
response = mock .Mock (spec = Response )
@@ -758,6 +823,13 @@ def test_spec_not_detected(self, spec_invalid):
758
823
with pytest .raises (SpecError ):
759
824
validate_webhook_response (request , response , spec = spec_invalid )
760
825
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
+
761
833
def test_request_type_invalid (self , spec_v31 ):
762
834
request = mock .sentinel .request
763
835
response = mock .Mock (spec = Response )
@@ -819,6 +891,14 @@ def test_spec_not_detected(self, spec_invalid):
819
891
with pytest .warns (DeprecationWarning ):
820
892
validate_response (request , response , spec = spec_invalid )
821
893
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
+
822
902
def test_request_type_invalid (self , spec_v31 ):
823
903
request = mock .sentinel .request
824
904
response = mock .Mock (spec = Response )
0 commit comments