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
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
def test_isfile_with_dir(smb_share): dir_name = "%s\\dir" % smb_share mkdir(dir_name) assert isfile(dir_name) is False
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
def test_isfile_no_path(smb_share): assert isfile("%s\\missing\\file.txt" % smb_share) is False
def test_isfile_missing(smb_share): assert isfile("%s\\missing" % smb_share) is False