本文整理匯總了Python中hpack.hpack.Decoder.max_allowed_table_size方法的典型用法代碼示例。如果您正苦於以下問題:Python Decoder.max_allowed_table_size方法的具體用法?Python Decoder.max_allowed_table_size怎麽用?Python Decoder.max_allowed_table_size使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類hpack.hpack.Decoder
的用法示例。
在下文中一共展示了Decoder.max_allowed_table_size方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_table_size_not_adjusting
# 需要導入模塊: from hpack.hpack import Decoder [as 別名]
# 或者: from hpack.hpack.Decoder import max_allowed_table_size [as 別名]
def test_table_size_not_adjusting(self):
"""
If the header table size is shrunk, and then the remote peer doesn't
join in the shrinking, then an error is raised.
"""
d = Decoder()
d.max_allowed_table_size = 128
data = b'\x82\x87\x84A\x8a\x08\x9d\\\x0b\x81p\xdcy\xa6\x99'
with pytest.raises(InvalidTableSizeError):
d.decode(data)
示例2: test_header_table_size_change_above_maximum
# 需要導入模塊: from hpack.hpack import Decoder [as 別名]
# 或者: from hpack.hpack.Decoder import max_allowed_table_size [as 別名]
def test_header_table_size_change_above_maximum(self):
"""
If a header table size change is received that exceeds the maximum
allowed table size, it is rejected.
"""
d = Decoder()
d.max_allowed_table_size = 127
data = b'?a\x82\x87\x84A\x8a\x08\x9d\\\x0b\x81p\xdcy\xa6\x99'
with pytest.raises(InvalidTableSizeError):
d.decode(data)