Exemplo 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()
Exemplo 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()
Exemplo 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()
Exemplo 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()