本文整理汇总了Python中hyper.common.headers.HTTPHeaderMap.iter_raw方法的典型用法代码示例。如果您正苦于以下问题:Python HTTPHeaderMap.iter_raw方法的具体用法?Python HTTPHeaderMap.iter_raw怎么用?Python HTTPHeaderMap.iter_raw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hyper.common.headers.HTTPHeaderMap
的用法示例。
在下文中一共展示了HTTPHeaderMap.iter_raw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_raw_iteration
# 需要导入模块: from hyper.common.headers import HTTPHeaderMap [as 别名]
# 或者: from hyper.common.headers.HTTPHeaderMap import iter_raw [as 别名]
def test_raw_iteration(self):
items = [
(b'k1', b'v2'),
(b'k2', b'v2, v3, v4'),
(b'k2', b'v3'),
]
h = HTTPHeaderMap(items)
assert list(h.iter_raw()) == items
示例2: test_merge_headermaps_preserves_raw
# 需要导入模块: from hyper.common.headers import HTTPHeaderMap [as 别名]
# 或者: from hyper.common.headers.HTTPHeaderMap import iter_raw [as 别名]
def test_merge_headermaps_preserves_raw(self):
h1 = HTTPHeaderMap([
(b'hi', b'there')
])
h2 = HTTPHeaderMap([
(b'Hi', b'there, sir, maam')
])
h1.merge(h2)
assert list(h1.iter_raw()) == [
(b'hi', b'there'),
(b'Hi', b'there, sir, maam'),
]