当前位置: 首页>>代码示例>>Python>>正文


Python HTTPHeaders.get_list方法代码示例

本文整理汇总了Python中tornado.httputil.HTTPHeaders.get_list方法的典型用法代码示例。如果您正苦于以下问题:Python HTTPHeaders.get_list方法的具体用法?Python HTTPHeaders.get_list怎么用?Python HTTPHeaders.get_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tornado.httputil.HTTPHeaders的用法示例。


在下文中一共展示了HTTPHeaders.get_list方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_copy

# 需要导入模块: from tornado.httputil import HTTPHeaders [as 别名]
# 或者: from tornado.httputil.HTTPHeaders import get_list [as 别名]
 def test_copy(self):
     all_pairs = [('A', '1'), ('A', '2'), ('B', 'c')]
     h1 = HTTPHeaders()
     for k, v in all_pairs:
         h1.add(k, v)
     h2 = h1.copy()
     h3 = copy.copy(h1)
     h4 = copy.deepcopy(h1)
     for headers in [h1, h2, h3, h4]:
         # All the copies are identical, no matter how they were
         # constructed.
         self.assertEqual(list(sorted(headers.get_all())), all_pairs)
     for headers in [h2, h3, h4]:
         # Neither the dict or its member lists are reused.
         self.assertIsNot(headers, h1)
         self.assertIsNot(headers.get_list('A'), h1.get_list('A'))
开发者ID:FlorianLudwig,项目名称:tornado,代码行数:18,代码来源:httputil_test.py


注:本文中的tornado.httputil.HTTPHeaders.get_list方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。