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