@@ -179,7 +179,7 @@ def test_data_frame_without_padding_calculates_flow_control_len(self):
179
179
assert f .flow_controlled_length == 8
180
180
181
181
def test_data_frame_comes_on_a_stream (self ):
182
- with pytest .raises (ValueError ):
182
+ with pytest .raises (InvalidFrameError ):
183
183
DataFrame (0 )
184
184
185
185
def test_long_data_frame (self ):
@@ -263,13 +263,13 @@ def test_priority_frame_with_all_data_parses_properly(self):
263
263
assert f .body_len == 5
264
264
265
265
def test_priority_frame_invalid (self ):
266
- with pytest .raises (ValueError ):
266
+ with pytest .raises (InvalidFrameError ):
267
267
decode_frame (
268
268
b'\x00 \x00 \x06 \x02 \x00 \x00 \x00 \x00 \x01 \x80 \x00 \x00 \x04 \x40 \xFF '
269
269
)
270
270
271
271
def test_priority_frame_comes_on_a_stream (self ):
272
- with pytest .raises (ValueError ):
272
+ with pytest .raises (InvalidFrameError ):
273
273
PriorityFrame (0 )
274
274
275
275
def test_short_priority_frame_errors (self ):
@@ -301,12 +301,12 @@ def test_rst_stream_frame_parses_properly(self):
301
301
assert f .body_len == 4
302
302
303
303
def test_rst_stream_frame_comes_on_a_stream (self ):
304
- with pytest .raises (ValueError ):
304
+ with pytest .raises (InvalidFrameError ):
305
305
RstStreamFrame (0 )
306
306
307
307
def test_rst_stream_frame_must_have_body_length_four (self ):
308
308
f = RstStreamFrame (1 )
309
- with pytest .raises (ValueError ):
309
+ with pytest .raises (InvalidFrameError ):
310
310
f .parse_body (b'\x01 ' )
311
311
312
312
@@ -358,10 +358,10 @@ def test_settings_frame_with_ack(self):
358
358
assert 'ACK' in f .flags
359
359
360
360
def test_settings_frame_ack_and_settings (self ):
361
- with pytest .raises (ValueError ):
361
+ with pytest .raises (InvalidFrameError ):
362
362
SettingsFrame (settings = self .settings , flags = ('ACK' ,))
363
363
364
- with pytest .raises (ValueError ):
364
+ with pytest .raises (InvalidFrameError ):
365
365
decode_frame (self .serialized )
366
366
367
367
def test_settings_frame_parses_properly (self ):
@@ -376,13 +376,13 @@ def test_settings_frame_parses_properly(self):
376
376
assert f .body_len == 42
377
377
378
378
def test_settings_frame_invalid_body_length (self ):
379
- with pytest .raises (ValueError ):
379
+ with pytest .raises (InvalidFrameError ):
380
380
decode_frame (
381
381
b'\x00 \x00 \x2A \x04 \x00 \x00 \x00 \x00 \x00 \xFF \xFF \xFF \xFF '
382
382
)
383
383
384
384
def test_settings_frames_never_have_streams (self ):
385
- with pytest .raises (ValueError ):
385
+ with pytest .raises (InvalidFrameError ):
386
386
SettingsFrame (stream_id = 1 )
387
387
388
388
def test_short_settings_frame_errors (self ):
@@ -497,7 +497,7 @@ def test_no_more_than_8_octets(self):
497
497
f = PingFrame ()
498
498
f .opaque_data = b'\x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 '
499
499
500
- with pytest .raises (ValueError ):
500
+ with pytest .raises (InvalidFrameError ):
501
501
f .serialize ()
502
502
503
503
def test_ping_frame_parses_properly (self ):
@@ -513,17 +513,17 @@ def test_ping_frame_parses_properly(self):
513
513
assert f .body_len == 8
514
514
515
515
def test_ping_frame_never_has_a_stream (self ):
516
- with pytest .raises (ValueError ):
516
+ with pytest .raises (InvalidFrameError ):
517
517
PingFrame (stream_id = 1 )
518
518
519
519
def test_ping_frame_has_no_more_than_body_length_8 (self ):
520
520
f = PingFrame ()
521
- with pytest .raises (ValueError ):
521
+ with pytest .raises (InvalidFrameError ):
522
522
f .parse_body (b'\x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 ' )
523
523
524
524
def test_ping_frame_has_no_less_than_body_length_8 (self ):
525
525
f = PingFrame ()
526
- with pytest .raises (ValueError ):
526
+ with pytest .raises (InvalidFrameError ):
527
527
f .parse_body (b'\x01 \x02 \x03 \x04 \x05 \x06 \x07 ' )
528
528
529
529
@@ -577,7 +577,7 @@ def test_goaway_frame_parses_properly(self):
577
577
assert f .body_len == 8
578
578
579
579
def test_goaway_frame_never_has_a_stream (self ):
580
- with pytest .raises (ValueError ):
580
+ with pytest .raises (InvalidFrameError ):
581
581
GoAwayFrame (stream_id = 1 )
582
582
583
583
def test_short_goaway_frame_errors (self ):
@@ -829,14 +829,14 @@ def test_short_altsvc_frame_errors(self):
829
829
decode_frame (self .payload_with_origin [:10 ])
830
830
831
831
def test_altsvc_with_unicode_origin_fails (self ):
832
- with pytest .raises (ValueError ):
832
+ with pytest .raises (InvalidFrameError ):
833
833
AltSvcFrame (
834
834
stream_id = 0 , origin = u'hello' , field = b'h2=":8000"; ma=60'
835
835
836
836
)
837
837
838
838
def test_altsvc_with_unicode_field_fails (self ):
839
- with pytest .raises (ValueError ):
839
+ with pytest .raises (InvalidFrameError ):
840
840
AltSvcFrame (
841
841
stream_id = 0 , origin = b'hello' , field = u'h2=":8000"; ma=60'
842
842
)
0 commit comments