Ejemplo n.º 1
0
    def test_delete_invld(self):
        """Test deletion of a folder we can't access."""
        dirpath = tempfile.mkdtemp()

        os.chmod(dirpath, 0)
        with pytest.raises(CuckooOperationalError):
            Folders.delete(dirpath)

        os.chmod(dirpath, 0o775)
        Folders.delete(dirpath)
Ejemplo n.º 2
0
 def test_delete_folder2(self):
     """Test folder deletion #2."""
     Folders.create(self.tmp_dir, "foo")
     assert os.path.exists(os.path.join(self.tmp_dir, "foo"))
     Folders.delete(self.tmp_dir, "foo")
     assert not os.path.exists(os.path.join(self.tmp_dir, "foo"))