Beispiel #1
0
 def test_delete_header(self):
     d = HeaderDict()
     d['Content-Type'] = 'test'
     d['Test'] = 'test'
     assert d.get('Content-Type')
     del d['Content-Type']
     assert not d.get('Content-Type')
Beispiel #2
0
 def test_delete_header(self):
     d = HeaderDict()
     d['Content-Type'] = 'test'
     d['Test'] = 'test'
     assert d.get('Content-Type')
     del d['Content-Type']
     assert not d.get('Content-Type')
Beispiel #3
0
 def test_add_header(self):
     d = HeaderDict()
     d.add('CONTENT_TYPE', 'text/html')
     assert d.get('Content-Type') == 'text/html'
     assert d.get('CONTENT_TYPE') == 'text/html'
Beispiel #4
0
 def test_add_option(self):
     d = HeaderDict()
     d.add('CONTENT_TYPE', 'text/html', charset='utf-8')
     assert d.get('Content-Type') == 'text/html; charset=utf-8'
     assert d.get_option('Content-Type', 'charset') == 'utf-8'
     assert d.get_option('Content-Type', 'random', 'test') == 'test'
Beispiel #5
0
 def test_add_header(self):
     d = HeaderDict()
     d.add('CONTENT_TYPE', 'text/html')
     assert d.get('Content-Type') == 'text/html'
     assert d.get('CONTENT_TYPE') == 'text/html'
Beispiel #6
0
 def test_add_option(self):
     d = HeaderDict()
     d.add('CONTENT_TYPE', 'text/html', charset='utf-8')
     assert d.get('Content-Type') == 'text/html; charset=utf-8'
     assert d.get_option('Content-Type', 'charset') == 'utf-8'
     assert d.get_option('Content-Type', 'random', 'test') == 'test'