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
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
def test_search_in_static_partial(self): tbl = HeaderTable() exp = (1, b':authority', None) res = tbl.search(b':authority', b'NotInTable') assert res == exp
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
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
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