Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit 998f1c2

Browse files
committed
Confirm we can resize header tables.
1 parent 3868215 commit 998f1c2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/test_hyper.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,26 @@ def test_connections_increment_send_window_properly(self):
906906

907907
assert c._out_flow_control_window == 65535 + 1000
908908

909+
def test_connections_handle_resizing_header_tables_properly(self):
910+
sock = DummySocket()
911+
f = SettingsFrame(0)
912+
f.settings[SettingsFrame.HEADER_TABLE_SIZE] = 1024
913+
c = HTTP20Connection('www.google.com')
914+
c._sock = sock
915+
916+
# 'Receive' the SETTINGS frame.
917+
c.receive_frame(f)
918+
919+
# Confirm that the setting is stored and the header table shrunk.
920+
assert c._settings[SettingsFrame.HEADER_TABLE_SIZE] == 1024
921+
assert c.encoder.header_table_size == 1024
922+
923+
# Confirm we got a SETTINGS ACK.
924+
f2 = decode_frame(sock.queue[0])
925+
assert isinstance(f2, SettingsFrame)
926+
assert f2.stream_id == 0
927+
assert f2.flags == set(['ACK'])
928+
909929

910930
class TestHyperStream(object):
911931
def test_streams_have_ids(self):

0 commit comments

Comments
 (0)