예제 #1
0
 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()
예제 #2
0
 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()
예제 #3
0
 def test_read_only(self):
     mb = MemoryBuffer(self.data)
     io = IOBuffer(mb, mode='r')
     self.assertRaises(IOError, io.write, self.data)
     assert not io.writeable()