コード例 #1
0
ファイル: test_table.py プロジェクト: irvind/hpack
 def test_search_in_dynamic_partial(self):
     tbl = HeaderTable()
     idx = len(HeaderTable.STATIC_TABLE) + 1
     tbl.add(b'TestName', b'TestValue')
     exp = (idx , b'TestName', None)
     res = tbl.search(b'TestName', b'NotInTable')
     assert res == exp
コード例 #2
0
 def test_search_in_dynamic_full(self):
     tbl = HeaderTable()
     idx = len(HeaderTable.STATIC_TABLE) + 1
     tbl.add(b'TestName', b'TestValue')
     exp = (idx, b'TestName', b'TestValue')
     res = tbl.search(b'TestName', b'TestValue')
     assert res == exp
コード例 #3
0
 def test_search_in_static_partial(self):
     tbl = HeaderTable()
     exp = (1, b':authority', None)
     res = tbl.search(b':authority', b'NotInTable')
     assert res == exp
コード例 #4
0
 def test_search_in_static_full(self):
     tbl = HeaderTable()
     itm = (b':authority', b'')
     exp = (1, itm[0], itm[1])
     res = tbl.search(itm[0], itm[1])
     assert res == exp
コード例 #5
0
 def test_search_no_match(self):
     tbl = HeaderTable()
     tbl.add(b'TestName', b'TestValue')
     res = tbl.search(b'NotInTable', b'NotInTable')
     assert res is None
コード例 #6
0
ファイル: test_table.py プロジェクト: irvind/hpack
 def test_search_in_static_partial(self):
     tbl = HeaderTable()
     exp = (1, b':authority', None)
     res = tbl.search(b':authority', b'NotInTable')
     assert res == exp
コード例 #7
0
ファイル: test_table.py プロジェクト: irvind/hpack
 def test_search_in_static_full(self):
     tbl = HeaderTable()
     itm = (b':authority', b'')
     exp = (1, itm[0], itm[1])
     res = tbl.search(itm[0], itm[1])
     assert res == exp
コード例 #8
0
ファイル: test_table.py プロジェクト: irvind/hpack
 def test_search_no_match(self):
     tbl = HeaderTable()
     idx = len(HeaderTable.STATIC_TABLE)
     tbl.add(b'TestName', b'TestValue')
     res = tbl.search(b'NotInTable', b'NotInTable')
     assert res is None
コード例 #9
0
ファイル: test_table.py プロジェクト: Coder206/servo
 def test_search_no_match(self):
     tbl = HeaderTable()
     tbl.add(b'TestName', b'TestValue')
     res = tbl.search(b'NotInTable', b'NotInTable')
     assert res is None