コード例 #1
0
ファイル: test_headers.py プロジェクト: B-Rich/watson-http
 def test_tuple_pairs(self):
     d = HeaderCollection.from_environ({'CONTENT_TYPE': 'text/html'})
     assert d() == [('Content-Type', 'text/html')]
コード例 #2
0
ファイル: test_headers.py プロジェクト: B-Rich/watson-http
 def test_set_header_immutable(self):
     d = HeaderCollection.from_environ({'CONTENT_TYPE': 'text/html'})
     with raises(TypeError):
         d['test'] = 'test'
     with raises(TypeError):
         del d['CONTENT_TYPE']
コード例 #3
0
ファイル: messages.py プロジェクト: watsonpy/watson-http
 def headers(self):
     return HeaderCollection.from_environ(self.environ)