Пример #1
0
def test_hardlinks_to_copies(testing_workdir):
    with open('test1', 'w') as f:
        f.write("\n")

    os.link('test1', 'test2')
    assert os.lstat('test1').st_nlink == 2
    assert os.lstat('test2').st_nlink == 2

    post.make_hardlink_copy('test1', os.getcwd())
    post.make_hardlink_copy('test2', os.getcwd())

    assert os.lstat('test1').st_nlink == 1
    assert os.lstat('test2').st_nlink == 1
Пример #2
0
def test_hardlinks_to_copies(testing_workdir):
    with open('test1', 'w') as f:
        f.write("\n")

    os.link('test1', 'test2')
    assert os.lstat('test1').st_nlink == 2
    assert os.lstat('test2').st_nlink == 2

    post.make_hardlink_copy('test1', os.getcwd())
    post.make_hardlink_copy('test2', os.getcwd())

    assert os.lstat('test1').st_nlink == 1
    assert os.lstat('test2').st_nlink == 1