def header_docstring(header, rfc_section): if header.isupper(): header = _trans_key(header) major_section = rfc_section.split('.')[0] link = 'http://www.w3.org/Protocols/rfc2616/rfc2616-sec%s.html#sec%s' % (major_section, rfc_section) return "Gets and sets the ``%s`` header (`HTTP spec section %s <%s>`_)." \ % (header, rfc_section, link)
def test__trans_key_not_a_header(): result = headers._trans_key('') eq_(result, None)
def test__trans_key_not_basestring(): result = headers._trans_key(None) eq_(result, None)
def test__trans_key_httpheader(): result = headers._trans_key('HTTP_FOO_BAR') assert result == 'Foo-Bar'
def test__trans_key_key2header(): result = headers._trans_key('CONTENT_TYPE') assert result == 'Content-Type'
def test__trans_key_not_a_header(): result = headers._trans_key('') assert result == None
def test__trans_key_not_a_header(): result = headers._trans_key("") assert result is None
def test__trans_key_httpheader(): result = headers._trans_key('HTTP_FOO_BAR') eq_(result, 'Foo-Bar')
def test__trans_key_key2header(): result = headers._trans_key('CONTENT_TYPE') eq_(result, 'Content-Type')
def test__trans_key_httpheader(): result = headers._trans_key("HTTP_FOO_BAR") assert result == "Foo-Bar"
def test__trans_key_key2header(): result = headers._trans_key("CONTENT_TYPE") assert result == "Content-Type"
def test__trans_key_not_basestring(): result = headers._trans_key(None) assert result == None
def test__trans_key_not_basestring(): result = headers._trans_key(None) assert result is None