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