<s> import sqlite3 <EOL> from dbbot import RobotDatabase <EOL> class DatabaseReader ( RobotDatabase ) : <EOL> def __init__ ( self , db_file_path , verbose_stream ) : <EOL> super ( DatabaseReader , self ) . __init__ ( db_file_path , verbose_stream ) <EOL> self . _connection . row_factory = sqlite3 . Row <EOL> def most_failed_suites ( self ) : <EOL> sql_statement = '''<STR_LIT>''' <EOL> return self . _fetch_by ( sql_statement ) <EOL> def most_failed_tests ( self ) : <EOL> sql_statement = '''<STR_LIT>''' <EOL> return self . _fetch_by ( sql_statement ) <EOL> def most_failed_keywords ( self ) : <EOL> sql_statement = '''<STR_LIT>''' <EOL> return self . _fetch_by ( sql_statement ) <EOL> def failed_tests_for_suite ( self , suite_id ) : <EOL> sql_statement = '''<STR_LIT>''' <EOL> return self . _fetch_by ( sql_statement , [ suite_id ] ) <EOL> def failed_keywords_for_test ( self , test_id ) : <EOL> sql_statement = '''<STR_LIT>''' <EOL> return self . _fetch_by ( sql_statement , [ test_id ] ) <EOL> def _fetch_by ( self , sql_statement , values = [ ] ) : <EOL> return self . _connection . execute ( sql_statement , values ) . fetchall ( ) </s>
