Esempio n. 1
0
def test_single_file(tmpdir):
    os.chdir(tmpdir.strpath)
    os.mknod("file")
    assert os.path.exists("file")
    osex.append_to_name("file", "-") 
    assert not os.path.exists("file")
    assert os.path.exists("file-")
Esempio n. 2
0
def test_single_dir(tmpdir):
    os.chdir(tmpdir.strpath)
    os.mkdir("dir")
    assert os.path.exists("dir")
    osex.append_to_name("dir", "+") 
    assert not os.path.exists("dir")
    assert os.path.exists("dir+")
Esempio n. 3
0
def test_empty_suffix(tmpdir):
    os.chdir(tmpdir.strpath)
    # file 1
    os.mknod("file")
    assert os.path.exists("file")
    osex.append_to_name("file", "") 
    assert not os.path.exists("file")
    assert os.path.exists("file1")
    # file 2
    os.mknod("file")
    assert os.path.exists("file")
    osex.append_to_name("file", "") 
    assert not os.path.exists("file")
    assert os.path.exists("file1")
    assert os.path.exists("file2")
    # file 3
    os.mknod("file")
    assert os.path.exists("file")
    osex.append_to_name("file", "") 
    assert not os.path.exists("file")
    assert os.path.exists("file1")
    assert os.path.exists("file2")
    assert os.path.exists("file3")
Esempio n. 4
0
def test_multiple_files(tmpdir):
    os.chdir(tmpdir.strpath)
    # file 1
    os.mknod("file")
    assert os.path.exists("file")
    osex.append_to_name("file", "-") 
    assert not os.path.exists("file")
    assert os.path.exists("file-")
    # file 2
    os.mknod("file")
    assert os.path.exists("file")
    osex.append_to_name("file", "-") 
    assert not os.path.exists("file")
    assert os.path.exists("file-")
    assert os.path.exists("file-1")
    # file 3
    os.mknod("file")
    assert os.path.exists("file")
    osex.append_to_name("file", "-") 
    assert not os.path.exists("file")
    assert os.path.exists("file-")
    assert os.path.exists("file-1")
    assert os.path.exists("file-2")