Example #1
0
 def test_empty_does_not_raise_exception(self):
     assert normalize_header_name("") == ""
Example #2
0
 def test_none_does_not_raise_exception(self):
     assert normalize_header_name(None) is None
Example #3
0
 def test_name_is_lowered(self):
     assert normalize_header_name("Content-Type") == "content-type"
Example #4
0
 def test_name_is_trimmed(self):
     assert normalize_header_name("   content-type   ") == "content-type"
Example #5
0
 def test_name_is_lowered(self):
     assert normalize_header_name('Content-Type') == 'content-type'
Example #6
0
def _normalized_header_name(header_name):
    # type: (str) -> str
    return NORMALIZE_PATTERN.sub("_", normalize_header_name(header_name))