예제 #1
0
def test_clean_do_not_remove_hidden_files():
    name = tmp_dir + "/" + ".toto.pyc"
    with open(name, 'w') as f:
        f.write("toto")

    clean(tmp_dir)
    assert exists(name)
예제 #2
0
def test_clean_do_not_remove_hidden_files(tmp_dir):
    name = tmp_dir + "/" + ".toto.pyc"
    with open(name, 'w') as f:
        f.write("toto")

    clean(tmp_dir)
    assert exists(name)
예제 #3
0
def test_clean_remove_pyc_files(tmp_dir):
    name = tmp_dir + "/" + "toto.pyc"
    with open(name, 'w') as f:
        f.write("toto")

    clean(tmp_dir)
    assert not exists(name)
예제 #4
0
def test_clean_remove_pyc_files():
    name = tmp_dir + "/" + "toto.pyc"
    with open(name, 'w') as f:
        f.write("toto")

    clean(tmp_dir)
    assert not exists(name)
예제 #5
0
def test_clean_remove_dist_build_directories(tmp_dir):
    for name in ("dist", "build"):
        ensure_created(tmp_dir / name)

    clean(tmp_dir)

    assert len(tuple(tmp_dir.iterdir())) == 0
예제 #6
0
def test_clean_do_not_remove_hidden_files(tmp_dir):
    pth = tmp_dir / ".toto.pyc"
    pth.write_text("toto")

    clean(tmp_dir)

    assert pth.exists()
예제 #7
0
def test_clean_remove_pyc_files(tmp_dir):
    pth = tmp_dir / "toto.pyc"
    pth.write_text("toto")

    clean(tmp_dir)

    assert not pth.exists()
예제 #8
0
def test_clean_do_not_explore_hidden_directories(tmp_dir):
    hidden = tmp_dir + "/" + ".test"
    mkdir(hidden)
    name = hidden + "/" + "toto.py"
    with open(name, 'w') as f:
        f.write("toto")

    clean(tmp_dir)
    assert exists(hidden)
    assert exists(name)
예제 #9
0
def test_clean_remove_pycache_directories(tmp_dir):
    pycache = tmp_dir + "/" + "__pycache__"
    mkdir(pycache)
    name = pycache + "/" + "toto.py"
    with open(name, 'w') as f:
        f.write("toto")

    clean(tmp_dir)
    assert not exists(pycache)
    assert not exists(name)
예제 #10
0
def test_clean_do_not_explore_hidden_directories():
    hidden = tmp_dir + "/" + ".test"
    mkdir(hidden)
    name = hidden + "/" + "toto.py"
    with open(name, 'w') as f:
        f.write("toto")

    clean(tmp_dir)
    assert exists(hidden)
    assert exists(name)
예제 #11
0
def test_clean_remove_pycache_directories():
    pycache = tmp_dir + "/" + "__pycache__"
    mkdir(pycache)
    name = pycache + "/" + "toto.py"
    with open(name, 'w') as f:
        f.write("toto")

    clean(tmp_dir)
    assert not exists(pycache)
    assert not exists(name)
예제 #12
0
def test_clean_do_not_explore_hidden_directories(tmp_dir):
    hidden = tmp_dir / ".test"
    ensure_created(hidden)
    pth = hidden / "toto.py"
    pth.write_text("toto")

    clean(tmp_dir)

    assert hidden.exists()
    assert pth.exists()
예제 #13
0
def test_clean_remove_pycache_directories(tmp_dir):
    pycache = tmp_dir / "__pycache__"
    ensure_created(pycache)
    pth = pycache / "toto.py"
    pth.write_text("toto")

    clean(tmp_dir)

    assert not pycache.exists()
    assert not pth.exists()
예제 #14
0
def test_clean_remove_dist_build_directories(tmp_dir):
    for name in ("dist", "build"):
        mkdir(tmp_dir + "/" + name)

    clean(tmp_dir)
    assert len(listdir(tmp_dir)) == 0
예제 #15
0
def test_clean_remove_dist_build_directories():
    for name in ("dist", "build"):
        mkdir(tmp_dir + "/" + name)

    clean(tmp_dir)
    assert len(listdir(tmp_dir)) == 0