def test_makedirs_exist_ok_creates_one_level(tmpdir):
    """
    If makedirs_exist_ok needs to create one level of directories, it will.
    """
    d = tmpdir.join('d')
    assert not d.exists()
    runit_sv.makedirs_exist_ok(d.strpath)
    assert d.check(dir=True)
예제 #2
0
def test_makedirs_exist_ok_creates_one_level(tmpdir):
    """
    If makedirs_exist_ok needs to create one level of directories, it will.
    """
    d = tmpdir.join('d')
    assert not d.exists()
    runit_sv.makedirs_exist_ok(d.strpath)
    assert d.check(dir=True)
def test_makedirs_exist_ok_propagates_makedirs_exceptions(tmpdir):
    """
    If the os.makedirs call in makedirs_exist_ok raises an exception that isn't
    EEXIST, it will be propagated upward.
    """
    d = tmpdir.join('d')
    tmpdir.chmod(0)
    with pytest.raises(OSError):
        runit_sv.makedirs_exist_ok(d.strpath)
def test_makedirs_exist_ok_ignores_extant_directories(tmpdir):
    """
    If makedirs_exist_ok is passed the path to an extant directory, the
    directory continues to exist but nothing else happens.
    """
    d = tmpdir.join('d')
    d.mkdir()
    runit_sv.makedirs_exist_ok(d.strpath)
    assert d.check(dir=True)
예제 #5
0
def test_makedirs_exist_ok_propagates_makedirs_exceptions(tmpdir):
    """
    If the os.makedirs call in makedirs_exist_ok raises an exception that isn't
    EEXIST, it will be propagated upward.
    """
    d = tmpdir.join('d')
    tmpdir.chmod(0)
    with pytest.raises(OSError):
        runit_sv.makedirs_exist_ok(d.strpath)
예제 #6
0
def test_makedirs_exist_ok_ignores_extant_directories(tmpdir):
    """
    If makedirs_exist_ok is passed the path to an extant directory, the
    directory continues to exist but nothing else happens.
    """
    d = tmpdir.join('d')
    d.mkdir()
    runit_sv.makedirs_exist_ok(d.strpath)
    assert d.check(dir=True)