diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-08-17 22:55:33 +0200 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-08-18 21:22:42 +0200 |
commit | 0d384ac2a91898d4c8623290ae0fb3a60a35e514 (patch) | |
tree | 8396169d0ebd6495f30c70fb060c8825320bbd12 /test/http/http2/test_protocol.py | |
parent | 12efa61e3af1b0ede4a803320b6f2a14b034aa5d (diff) | |
download | mitmproxy-0d384ac2a91898d4c8623290ae0fb3a60a35e514.tar.gz mitmproxy-0d384ac2a91898d4c8623290ae0fb3a60a35e514.tar.bz2 mitmproxy-0d384ac2a91898d4c8623290ae0fb3a60a35e514.zip |
http2: add support for too large data frames
Diffstat (limited to 'test/http/http2/test_protocol.py')
-rw-r--r-- | test/http/http2/test_protocol.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/test/http/http2/test_protocol.py b/test/http/http2/test_protocol.py index 0431de34..7f3fd2bd 100644 --- a/test/http/http2/test_protocol.py +++ b/test/http/http2/test_protocol.py @@ -252,20 +252,25 @@ class TestCreateHeaders(): class TestCreateBody(): c = tcp.TCPClient(("127.0.0.1", 0)) - protocol = HTTP2Protocol(c) def test_create_body_empty(self): - bytes = self.protocol._create_body(b'', 1) + protocol = HTTP2Protocol(self.c) + bytes = protocol._create_body(b'', 1) assert b''.join(bytes) == ''.decode('hex') def test_create_body_single_frame(self): - bytes = self.protocol._create_body('foobar', 1) + protocol = HTTP2Protocol(self.c) + bytes = protocol._create_body('foobar', 1) assert b''.join(bytes) == '000006000100000001666f6f626172'.decode('hex') def test_create_body_multiple_frames(self): - pass - # bytes = self.protocol._create_body('foobar' * 3000, 1) - # TODO: add test for too large frames + protocol = HTTP2Protocol(self.c) + protocol.http2_settings[SettingsFrame.SETTINGS.SETTINGS_MAX_FRAME_SIZE] = 5 + bytes = protocol._create_body('foobarmehm42', 1) + assert len(bytes) == 3 + assert bytes[0] == '000005000000000001666f6f6261'.decode('hex') + assert bytes[1] == '000005000000000001726d65686d'.decode('hex') + assert bytes[2] == '0000020001000000013432'.decode('hex') class TestReadRequest(tservers.ServerTestBase): |