class ByteArrayOutputStreamTest(unittest.TestCase): def setUp(self): self.__outputStream = ByteArrayOutputStream() def tearDown(self): self.__outputStream.close() self.__outputStream = None def test_write(self): parts = ('th', 'is is', ' some ', 't', 'ext') for part in parts: self.__outputStream.write(part) self.assertEquals(''.join(parts), self.__outputStream.buffer())
def setUp(self): self.__outputStream = ByteArrayOutputStream()