本文整理匯總了Python中flanker.mime.message.headers.MimeHeaders.keys方法的典型用法代碼示例。如果您正苦於以下問題:Python MimeHeaders.keys方法的具體用法?Python MimeHeaders.keys怎麽用?Python MimeHeaders.keys使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類flanker.mime.message.headers.MimeHeaders
的用法示例。
在下文中一共展示了MimeHeaders.keys方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: headers_order_preserved_test
# 需要導入模塊: from flanker.mime.message.headers import MimeHeaders [as 別名]
# 或者: from flanker.mime.message.headers.MimeHeaders import keys [as 別名]
def headers_order_preserved_test():
headers = [('mime-version', '1'), ('rEceived', '2'), ('mime-version', '3'), ('ReceiveD', '4')]
h = MimeHeaders(headers)
# various types of iterations
should_be = [('Mime-Version', '1'), ('Received', '2'), ('Mime-Version', '3'), ('Received', '4')]
eq_(should_be, h.items())
ok_(isinstance(h.items(), list))
eq_(should_be, [p for p in h.iteritems()])
# iterate over keys
keys = ['Mime-Version', 'Received', 'Mime-Version', 'Received']
eq_(keys, [p for p in h])
eq_(keys, h.keys())