<s> from rally import exceptions <EOL> class FunctionalMixin ( object ) : <EOL> """<STR_LIT>""" <EOL> def _concatenate_message ( self , default , extended ) : <EOL> if not extended : <EOL> return default <EOL> if default [ - <NUM_LIT:1> ] != "<STR_LIT:.>" : <EOL> default += "<STR_LIT:.>" <EOL> return default + "<STR_LIT:U+0020>" + extended . capitalize ( ) <EOL> def assertEqual ( self , first , second , err_msg = None ) : <EOL> if first != second : <EOL> msg = "<STR_LIT>" % ( repr ( first ) , <EOL> repr ( second ) ) <EOL> raise exceptions . RallyAssertionError ( <EOL> self . _concatenate_message ( msg , err_msg ) ) <EOL> def assertNotEqual ( self , first , second , err_msg = None ) : <EOL> if first == second : <EOL> msg = "<STR_LIT>" % ( repr ( first ) , <EOL> repr ( second ) ) <EOL> raise exceptions . RallyAssertionError ( <EOL> self . _concatenate_message ( msg , err_msg ) ) <EOL> def assertTrue ( self , value , err_msg = None ) : <EOL> if not value : <EOL> msg = "<STR_LIT>" % repr ( value ) <EOL> raise exceptions . RallyAssertionError ( <EOL> self . _concatenate_message ( msg , err_msg ) ) <EOL> def assertFalse ( self , value , err_msg = None ) : <EOL> if value : <EOL> msg = "<STR_LIT>" % repr ( value ) <EOL> raise exceptions . RallyAssertionError ( <EOL> self . _concatenate_message ( msg , err_msg ) ) <EOL> def assertIs ( self , first , second , err_msg = None ) : <EOL> if first is not second : <EOL> msg = "<STR_LIT>" % ( repr ( first ) , <EOL> repr ( second ) ) <EOL> raise exceptions . RallyAssertionError ( <EOL> self . _concatenate_message ( msg , err_msg ) ) <EOL> def assertIsNot ( self , first , second , err_msg = None ) : <EOL> if first is second : <EOL> msg = "<STR_LIT>" % ( repr ( first ) , <EOL> repr ( second ) ) <EOL> raise exceptions . RallyAssertionError ( <EOL> self . _concatenate_message ( msg , err_msg ) ) <EOL> def assertIsNone ( self , value , err_msg = None ) : <EOL> if value is not None : <EOL> msg = "<STR_LIT>" % repr ( value ) <EOL> raise exceptions . RallyAssertionError ( <EOL> self . _concatenate_message ( msg , err_msg ) ) <EOL> def assertIsNotNone ( self , value , err_msg = None ) : <EOL> if value is None : <EOL> msg = "<STR_LIT>" % repr ( value ) <EOL> raise exceptions . RallyAssertionError ( <EOL> self . _concatenate_message ( msg , err_msg ) ) <EOL> def assertIn ( self , member , container , err_msg = None ) : <EOL> if member not in container : <EOL> msg = "<STR_LIT>" % ( repr ( member ) , <EOL> repr ( container ) ) <EOL> raise exceptions . RallyAssertionError ( <EOL> self . _concatenate_message ( msg , err_msg ) ) <EOL> def assertNotIn ( self , member , container , err_msg = None ) : <EOL> if member in container : <EOL> msg = "<STR_LIT>" % ( repr ( member ) , <EOL> repr ( container ) ) <EOL> raise exceptions . RallyAssertionError ( <EOL> self . _concatenate_message ( msg , err_msg ) ) <EOL> def assertIsInstance ( self , first , second , err_msg = None ) : <EOL> if not isinstance ( first , second ) : <EOL> msg = "<STR_LIT>" % ( repr ( first ) , <EOL> repr ( second ) ) <EOL> raise exceptions . RallyAssertionError ( <EOL> self . _concatenate_message ( msg , err_msg ) ) <EOL> def assertIsNotInstance ( self , first , second , err_msg = None ) : <EOL> if isinstance ( first , second ) : <EOL> msg = "<STR_LIT>" % ( repr ( first ) , <EOL> repr ( second ) ) <EOL> raise exceptions . RallyAssertionError ( <EOL> self . _concatenate_message ( msg , err_msg ) ) </s>
