Exemple #1
0
def test_exists(smb_share):
    filename = "%s\\file.txt" % smb_share

    assert exists(filename) is False

    with open_file(filename, mode='w') as fd:
        fd.write(u"content")

    assert exists(filename) is True
Exemple #2
0
def test_exists_broken_symlink(smb_share):
    src_filename = "%s\\file.txt" % smb_share
    dst_filename = "%s\\link.txt" % smb_share

    symlink(src_filename, dst_filename)

    assert exists(dst_filename) is False
Exemple #3
0
def test_exists_working_symlink(smb_share):
    src_filename = "%s\\file.txt" % smb_share
    dst_filename = "%s\\link.txt" % smb_share

    with open_file(src_filename, mode='w') as fd:
        fd.write(u"content")

    symlink(src_filename, dst_filename)

    assert exists(dst_filename) is True
Exemple #4
0
def test_exists_missing_path(smb_share):
    assert exists("%s\\missing dir" % smb_share) is False
    assert exists("%s\\missing dir\\file.txt" % smb_share) is False