示例#1
0
 def test_client_header(self):
     h = Headers()
     self.assertEqual(len(h), 0)
     h['content-type'] = 'text/html'
     self.assertEqual(h.get_all('content-type'), ['text/html'])
     self.assertEqual(len(h), 1)
     h['server'] = 'bla'
     self.assertEqual(len(h), 2)
     del h['content-type']
     self.assertEqual(len(h), 1)
     self.assertEqual(h.get_all('content-type', []), [])
示例#2
0
 def testClientHeader(self):
     h = Headers(kind='client')
     self.assertEqual(h.kind, 'client')
     self.assertEqual(len(h), 0)
     h['content-type'] = 'text/html'
     self.assertEqual(h.get_all('content-type'), ['text/html'])
     self.assertEqual(len(h), 1)
     h['server'] = 'bla'
     self.assertEqual(len(h), 1)
     del h['content-type']
     self.assertEqual(len(h), 0)
     self.assertEqual(h.get_all('content-type', []), [])
示例#3
0
文件: headers.py 项目: Danzeer/pulsar
 def testClientHeader(self):
     h = Headers(kind='client')
     self.assertEqual(h.kind, 'client')
     self.assertEqual(len(h), 0)
     h['content-type'] = 'text/html'
     self.assertEqual(h.get_all('content-type'), ['text/html'])
     self.assertEqual(len(h), 1)
     h['server'] = 'bla'
     self.assertEqual(len(h), 1)
     del h['content-type']
     self.assertEqual(len(h), 0)
     self.assertEqual(h.get_all('content-type', []), [])