diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/protocol/test_http2.py | 28 | ||||
-rw-r--r-- | test/pathod/test_protocols_http2.py | 6 |
2 files changed, 17 insertions, 17 deletions
diff --git a/test/mitmproxy/protocol/test_http2.py b/test/mitmproxy/protocol/test_http2.py index 4dce698d..c2f96559 100644 --- a/test/mitmproxy/protocol/test_http2.py +++ b/test/mitmproxy/protocol/test_http2.py @@ -15,7 +15,7 @@ from mitmproxy.proxy.config import ProxyConfig import netlib from ...netlib import tservers as netlib_tservers from netlib.exceptions import HttpException -from netlib.http.http2 import framereader +from netlib.http import http2 from .. import tservers @@ -55,7 +55,7 @@ class _Http2ServerBase(netlib_tservers.ServerTestBase): done = False while not done: try: - raw = b''.join(framereader.http2_read_raw_frame(self.rfile)) + raw = b''.join(http2.read_raw_frame(self.rfile)) events = h2_conn.receive_data(raw) except HttpException: print(traceback.format_exc()) @@ -243,7 +243,7 @@ class TestSimple(_Http2Test): done = False while not done: try: - raw = b''.join(framereader.http2_read_raw_frame(client.rfile)) + raw = b''.join(http2.read_raw_frame(client.rfile)) events = h2_conn.receive_data(raw) except HttpException: print(traceback.format_exc()) @@ -320,7 +320,7 @@ class TestRequestWithPriority(_Http2Test): done = False while not done: try: - raw = b''.join(framereader.http2_read_raw_frame(client.rfile)) + raw = b''.join(http2.read_raw_frame(client.rfile)) events = h2_conn.receive_data(raw) except HttpException: print(traceback.format_exc()) @@ -359,7 +359,7 @@ class TestRequestWithPriority(_Http2Test): done = False while not done: try: - raw = b''.join(framereader.http2_read_raw_frame(client.rfile)) + raw = b''.join(http2.read_raw_frame(client.rfile)) events = h2_conn.receive_data(raw) except HttpException: print(traceback.format_exc()) @@ -431,7 +431,7 @@ class TestPriority(_Http2Test): done = False while not done: try: - raw = b''.join(framereader.http2_read_raw_frame(client.rfile)) + raw = b''.join(http2.read_raw_frame(client.rfile)) events = h2_conn.receive_data(raw) except HttpException: print(traceback.format_exc()) @@ -508,7 +508,7 @@ class TestPriorityWithExistingStream(_Http2Test): done = False while not done: try: - raw = b''.join(framereader.http2_read_raw_frame(client.rfile)) + raw = b''.join(http2.read_raw_frame(client.rfile)) events = h2_conn.receive_data(raw) except HttpException: print(traceback.format_exc()) @@ -559,7 +559,7 @@ class TestStreamResetFromServer(_Http2Test): done = False while not done: try: - raw = b''.join(framereader.http2_read_raw_frame(client.rfile)) + raw = b''.join(http2.read_raw_frame(client.rfile)) events = h2_conn.receive_data(raw) except HttpException: print(traceback.format_exc()) @@ -609,7 +609,7 @@ class TestBodySizeLimit(_Http2Test): done = False while not done: try: - raw = b''.join(framereader.http2_read_raw_frame(client.rfile)) + raw = b''.join(http2.read_raw_frame(client.rfile)) events = h2_conn.receive_data(raw) except HttpException: print(traceback.format_exc()) @@ -694,7 +694,7 @@ class TestPushPromise(_Http2Test): responses = 0 while not done: try: - raw = b''.join(framereader.http2_read_raw_frame(client.rfile)) + raw = b''.join(http2.read_raw_frame(client.rfile)) events = h2_conn.receive_data(raw) except HttpException: print(traceback.format_exc()) @@ -747,7 +747,7 @@ class TestPushPromise(_Http2Test): responses = 0 while not done: try: - raw = b''.join(framereader.http2_read_raw_frame(client.rfile)) + raw = b''.join(http2.read_raw_frame(client.rfile)) events = h2_conn.receive_data(raw) except HttpException: print(traceback.format_exc()) @@ -807,7 +807,7 @@ class TestConnectionLost(_Http2Test): done = False while not done: try: - raw = b''.join(framereader.http2_read_raw_frame(client.rfile)) + raw = b''.join(http2.read_raw_frame(client.rfile)) h2_conn.receive_data(raw) except HttpException: print(traceback.format_exc()) @@ -864,7 +864,7 @@ class TestMaxConcurrentStreams(_Http2Test): ended_streams = 0 while ended_streams != len(new_streams): try: - header, body = framereader.http2_read_raw_frame(client.rfile) + header, body = http2.read_raw_frame(client.rfile) events = h2_conn.receive_data(b''.join([header, body])) except: break @@ -910,7 +910,7 @@ class TestConnectionTerminated(_Http2Test): connection_terminated_event = None while not done: try: - raw = b''.join(framereader.http2_read_raw_frame(client.rfile)) + raw = b''.join(http2.read_raw_frame(client.rfile)) events = h2_conn.receive_data(raw) for event in events: if isinstance(event, h2.events.ConnectionTerminated): diff --git a/test/pathod/test_protocols_http2.py b/test/pathod/test_protocols_http2.py index 8d7efc82..7f65c0eb 100644 --- a/test/pathod/test_protocols_http2.py +++ b/test/pathod/test_protocols_http2.py @@ -5,7 +5,7 @@ import hyperframe from netlib import tcp, http from netlib.tutils import raises from netlib.exceptions import TcpDisconnect -from netlib.http.http2 import framereader +from netlib.http import http2 from ..netlib import tservers as netlib_tservers @@ -112,11 +112,11 @@ class TestPerformServerConnectionPreface(netlib_tservers.ServerTestBase): self.wfile.flush() # check empty settings frame - raw = framereader.http2_read_raw_frame(self.rfile) + raw = http2.read_raw_frame(self.rfile) assert raw == codecs.decode('00000c040000000000000200000000000300000001', 'hex_codec') # check settings acknowledgement - raw = framereader.http2_read_raw_frame(self.rfile) + raw = http2.read_raw_frame(self.rfile) assert raw == codecs.decode('000000040100000000', 'hex_codec') # send settings acknowledgement |