Esempio n. 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()
Esempio n. 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()
Esempio n. 3
0
 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()
Esempio n. 4
0
 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()