示例#1
0
 def testConcatenatedChunks(self):
     chunked = ''.join([''.join(http.toChunk(t)) for t in self.strings])
     result = []
     buffer = ""
     for c in chunked:
         buffer = buffer + c
         try:
             data, buffer = http.fromChunk(buffer)
             result.append(data)
         except ValueError:
             pass
     self.assertEquals(result, self.strings)
示例#2
0
 def testChunks(self):
     for s in self.strings:
         self.assertEquals((s, ''), http.fromChunk(''.join(http.toChunk(s))))
示例#3
0
 def testChunks(self):
     for s in self.strings:
         self.assertEquals((s, ''), http.fromChunk(''.join(http.toChunk(s))))
     self.assertRaises(ValueError, http.fromChunk, '-5\r\nmalformed!\r\n')
示例#4
0
 def testChunks(self):
     for s in self.strings:
         self.assertEquals((s, ''),
                           http.fromChunk(''.join(http.toChunk(s))))