Beispiel #1
0
def test_rmtree(tmpdir):
    dirpath = tmpdir.join("foo")
    dirpath.ensure(dir=1)
    _rmtree(dirpath.strpath)
    assert not dirpath.check()
Beispiel #2
0
def test_rmtree_other_error(tmpdir, monkeypatch):
    def permdenied(_):
        raise OSError(errno.EPERM, "permission denied")

    monkeypatch.setattr(shutil, "rmtree", permdenied)
    _rmtree(tmpdir.strpath)
Beispiel #3
0
def test_rmtree_nonexistent(tmpdir):
    _rmtree(tmpdir.join("foobar").strpath)
Beispiel #4
0
def test_rmtree(tmpdir):
    dirpath = tmpdir.join("foo")
    dirpath.ensure(dir=1)
    _rmtree(dirpath.strpath)
    assert not dirpath.check()
Beispiel #5
0
def test_rmtree_other_error(tmpdir, monkeypatch):
    def permdenied(_):
        raise OSError(errno.EPERM, "permission denied")

    monkeypatch.setattr(shutil, "rmtree", permdenied)
    _rmtree(tmpdir.strpath)
Beispiel #6
0
def test_rmtree_nonexistent(tmpdir):
    _rmtree(tmpdir.join("foobar").strpath)