コード例 #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