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)
def testChunks(self): for s in self.strings: self.assertEquals((s, ''), http.fromChunk(''.join(http.toChunk(s))))
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')