def _check_marks(quteproc, quickmarks, expected, contains):
 if quickmarks:
  mark_file = os.path.join(quteproc.basedir, 'config', 'quickmarks')
 else:
  mark_file = os.path.join(quteproc.basedir, 'config', 'bookmarks', 'urls')
 quteproc.clear_data()
 quteproc.send_cmd(':save')
 quteproc.wait_for(message='Saved to {}'.format(mark_file))
 with open(mark_file, 'r', encoding='utf-8') as f:
  lines = f.readlines()
 matched_line = any((utils.pattern_match(pattern=expected, value=line.rstrip('\n')) for line in lines))
 assert (matched_line == contains), lines

def _check_marks ( quteproc , quickmarks , expected , contains ) : if quickmarks : mark_file = os . path . join ( quteproc . basedir , 'config' , 'quickmarks' ) else : mark_file = os . path . join ( quteproc . basedir , 'config' , 'bookmarks' , 'urls' ) quteproc . clear_data ( ) quteproc . send_cmd ( ':save' ) quteproc . wait_for ( message = 'Saved to {}' . format ( mark_file ) ) with open ( mark_file , 'r' , encoding = 'utf-8' ) as f : lines = f . readlines ( ) matched_line = any ( ( utils . pattern_match ( pattern = expected , value = line . rstrip ( '\n' ) ) for line in lines ) ) assert ( matched_line == contains ) , lines
make sure the given line does exist in the bookmarks .