Exemplo n.º 1
0
 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 6
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
Exemplo n.º 7
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
Exemplo n.º 8
0
 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
Exemplo n.º 9
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