Exemplo n.º 1
0
def test_rmtree(tmpdir):
    dirpath = tmpdir.join("foo")
    dirpath.ensure(dir=1)
    _rmtree(dirpath.strpath)
    assert not dirpath.check()
Exemplo n.º 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)
Exemplo n.º 3
0
def test_rmtree_nonexistent(tmpdir):
    _rmtree(tmpdir.join("foobar").strpath)
Exemplo n.º 4
0
def test_rmtree(tmpdir):
    dirpath = tmpdir.join("foo")
    dirpath.ensure(dir=1)
    _rmtree(dirpath.strpath)
    assert not dirpath.check()
Exemplo n.º 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)
Exemplo n.º 6
0
def test_rmtree_nonexistent(tmpdir):
    _rmtree(tmpdir.join("foobar").strpath)