示例#1
0
def test_isfile_with_broken_link(smb_share):
    src_filename = "%s\\file.txt" % smb_share
    dst_filename = "%s\\link.txt" % smb_share

    symlink(src_filename, dst_filename)

    assert isfile(dst_filename) is False
示例#2
0
def test_isfile_with_link(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 isfile(dst_filename) is True
示例#3
0
def test_isfile_with_dir(smb_share):
    dir_name = "%s\\dir" % smb_share
    mkdir(dir_name)
    assert isfile(dir_name) is False
示例#4
0
def test_isfile_with_file(smb_share):
    filename = "%s\\file.txt" % smb_share
    with open_file(filename, mode='w') as fd:
        fd.write(u"content")
    assert isfile(filename) is True
示例#5
0
def test_isfile_no_path(smb_share):
    assert isfile("%s\\missing\\file.txt" % smb_share) is False
示例#6
0
def test_isfile_missing(smb_share):
    assert isfile("%s\\missing" % smb_share) is False