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