本文整理汇总了Python中webob.descriptors.header_getter函数的典型用法代码示例。如果您正苦于以下问题:Python header_getter函数的具体用法?Python header_getter怎么用?Python header_getter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了header_getter函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_header_getter_unicode_fset
def test_header_getter_unicode_fset():
from webob.descriptors import header_getter
from webob import Response
resp = Response('aresp')
desc = header_getter('AHEADER', '14.3')
desc.fset(resp, 'avalue2')
assert desc.fget(resp) == 'avalue2'
开发者ID:invisibleroads,项目名称:webob,代码行数:7,代码来源:test_descriptors.py
示例2: test_header_getter_unicode_fset_none
def test_header_getter_unicode_fset_none():
from webob.descriptors import header_getter
from webob import Response
resp = Response('aresp')
desc = header_getter('AHEADER', '14.3')
desc.fset(resp, None)
eq_(desc.fget(resp), None)
开发者ID:GdZ,项目名称:scriptfile,代码行数:7,代码来源:test_descriptors.py
示例3: test_header_getter_unicode_fget_none
def test_header_getter_unicode_fget_none():
from webob.descriptors import header_getter
from webob import Response
resp = Response("aresp")
desc = header_getter("AHEADER", "14.3")
eq_(desc.fget(resp), None)
开发者ID:sigmavirus24,项目名称:webob,代码行数:7,代码来源:test_descriptors.py
示例4: test_header_getter_fset
def test_header_getter_fset():
from webob.descriptors import header_getter
from webob import Response
resp = Response('aresp')
desc = header_getter('AHEADER', '14.3')
desc.fset(resp, 'avalue')
eq_(desc.fget(resp), 'avalue')
开发者ID:GdZ,项目名称:scriptfile,代码行数:7,代码来源:test_descriptors.py
示例5: test_header_getter_fget
def test_header_getter_fget():
from webob.descriptors import header_getter
from webob import Response
resp = Response("aresp")
desc = header_getter("AHEADER", "14.3")
assert desc.fget(resp) is None
开发者ID:Pylons,项目名称:webob,代码行数:7,代码来源:test_descriptors.py
示例6: test_header_getter_fset_text
def test_header_getter_fset_text():
from webob.compat import text_
from webob.descriptors import header_getter
from webob import Response
resp = Response('aresp')
desc = header_getter('AHEADER', '14.3')
desc.fset(resp, text_('avalue'))
assert desc.fget(resp) == 'avalue'
开发者ID:invisibleroads,项目名称:webob,代码行数:8,代码来源:test_descriptors.py
示例7: test_header_getter_fset_none
def test_header_getter_fset_none():
from webob.descriptors import header_getter
from webob import Response
resp = Response('aresp')
desc = header_getter('AHEADER', '14.3')
desc.fset(resp, 'avalue')
desc.fset(resp, None)
assert desc.fget(resp) == None
开发者ID:invisibleroads,项目名称:webob,代码行数:8,代码来源:test_descriptors.py
示例8: test_header_getter_fset_text_control_chars
def test_header_getter_fset_text_control_chars():
from webob.compat import text_
from webob.descriptors import header_getter
from webob import Response
resp = Response("aresp")
desc = header_getter("AHEADER", "14.3")
assert_raises(ValueError, desc.fset, resp, text_("\n"))
开发者ID:sigmavirus24,项目名称:webob,代码行数:8,代码来源:test_descriptors.py
示例9: test_header_getter_fset_text_control_chars
def test_header_getter_fset_text_control_chars():
from webob.compat import text_
from webob.descriptors import header_getter
from webob import Response
resp = Response('aresp')
desc = header_getter('AHEADER', '14.3')
with pytest.raises(ValueError):
desc.fset(resp, text_('\n'))
开发者ID:adamchainz,项目名称:webob,代码行数:8,代码来源:test_descriptors.py
示例10: test_header_getter_doc
def test_header_getter_doc():
from webob.descriptors import header_getter
desc = header_getter("X-Header", "14.3")
assert (
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3" in desc.__doc__
)
assert "``X-Header`` header" in desc.__doc__
开发者ID:Pylons,项目名称:webob,代码行数:8,代码来源:test_descriptors.py
示例11: test_header_getter_doc
def test_header_getter_doc():
from webob.descriptors import header_getter
desc = header_getter('X-Header', '14.3')
assert('http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3'
in desc.__doc__)
assert '``X-Header`` header' in desc.__doc__
开发者ID:invisibleroads,项目名称:webob,代码行数:6,代码来源:test_descriptors.py
示例12: test_header_getter_unicode
def test_header_getter_unicode():
from webob.descriptors import header_getter
desc = header_getter('AHEADER', '14.3')
eq_(desc.__doc__, "Gets and sets and deletes the AHEADER header. For "
"more information on AHEADER see `section 14.3 "
"<http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3>`_.")
开发者ID:AgentJay,项目名称:webapp-improved,代码行数:6,代码来源:test_descriptors.py
注:本文中的webob.descriptors.header_getter函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论