Esempio n. 1
0
 def testSetReadOnlyFalse(self):
     """Test that a readonly file can be made writeable."""
     osutils.set_readonly(self.readonly, False)
     self.assertTrue(os.access(self.readonly, os.W_OK))
Esempio n. 2
0
 def CreateFile(self, readonlystate):
     p = osutils.mktemp('readonlystate_%s' % readonlystate)
     osutils.set_readonly(p, readonlystate)
     self._files.append(p)
     return p
Esempio n. 3
0
 def testSetReadOnlyTrue(self):
     """Test that a writeable file can be made read only."""
     osutils.set_readonly(self.writeable, True)
     self.assertFalse(os.access(self.writeable, os.W_OK))
Esempio n. 4
0
 def tearDown(self):
     map(lambda p: osutils.set_readonly(p, False), self._files)
     map(os.remove, self._files)