def test_makereadonly_dir(self):
     temp = tempfile.mkdtemp()
     try:
         self.assertTrue(is_writable(temp))
         make_readonly(temp)
         self.assertFalse(is_writable(temp))
     finally:
         rmtree_readonly(temp)
Example #2
0
 def test_makereadonly_dir(self):
     temp = tempfile.mkdtemp()
     try:
         self.assertTrue(is_writable(temp))
         make_readonly(temp)
         self.assertFalse(is_writable(temp))
     finally:
         rmtree_readonly(temp)
Example #3
0
 def test_makereadonly_file(self):
     f = tempfile.NamedTemporaryFile()
     path = Path(f.name)
     self.assertTrue(is_writable(path))
     make_readonly(path)
     self.assertFalse(is_writable(path))
 def test_makereadonly_file(self):
     f = tempfile.NamedTemporaryFile()
     path = Path(f.name)
     self.assertTrue(is_writable(path))
     make_readonly(path)
     self.assertFalse(is_writable(path))