def test_closed(self): mb = MemoryBuffer(self.data) io = IOBuffer(mb) io.close() with self.assertRaises(IOError): io.write(self.data) assert not io.readable() and not io.writeable()
def test_read_only(self): mb = MemoryBuffer(self.data) io = IOBuffer(mb, mode='r') with self.assertRaises(IOError): io.write(self.data) assert not io.writeable()