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))
def CreateFile(self, readonlystate): p = osutils.mktemp('readonlystate_%s' % readonlystate) osutils.set_readonly(p, readonlystate) self._files.append(p) return p
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))
def tearDown(self): map(lambda p: osutils.set_readonly(p, False), self._files) map(os.remove, self._files)