File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -20,15 +20,18 @@ def test_one_input(data):
20
20
21
21
try :
22
22
next (parser )
23
- except StopIteration :
24
- pass # request is available in exc.value
23
+ except StopIteration as exc :
24
+ assert isinstance (exc .value , Request )
25
+ return
25
26
except (
26
27
EOFError , # connection is closed without a full HTTP request
27
28
SecurityError , # request exceeds a security limit
28
29
ValueError , # request isn't well formatted
29
30
):
30
31
pass
31
32
33
+ raise RuntimeError ("parsing didn't complete" )
34
+
32
35
33
36
def main ():
34
37
atheris .Setup (sys .argv , test_one_input )
Original file line number Diff line number Diff line change @@ -21,8 +21,9 @@ def test_one_input(data):
21
21
)
22
22
try :
23
23
next (parser )
24
- except StopIteration :
25
- pass # response is available in exc.value
24
+ except StopIteration as exc :
25
+ assert isinstance (exc .value , Response )
26
+ return
26
27
except (
27
28
EOFError , # connection is closed without a full HTTP response
28
29
SecurityError , # response exceeds a security limit
@@ -31,6 +32,8 @@ def test_one_input(data):
31
32
):
32
33
pass
33
34
35
+ raise RuntimeError ("parsing didn't complete" )
36
+
34
37
35
38
def main ():
36
39
atheris .Setup (sys .argv , test_one_input )
Original file line number Diff line number Diff line change @@ -28,14 +28,17 @@ def test_one_input(data):
28
28
29
29
try :
30
30
next (parser )
31
- except StopIteration :
32
- pass # response is available in exc.value
31
+ except StopIteration as exc :
32
+ assert isinstance (exc .value , Frame )
33
+ return
33
34
except (
34
35
PayloadTooBig , # frame's payload size exceeds ``max_size``
35
36
ProtocolError , # frame contains incorrect values
36
37
):
37
38
pass
38
39
40
+ raise RuntimeError ("parsing didn't complete" )
41
+
39
42
40
43
def main ():
41
44
atheris .Setup (sys .argv , test_one_input )
You can’t perform that action at this time.
0 commit comments