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
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
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
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