<s> from rx . internal . basic import default_comparer <EOL> def create_message ( actual , expected ) : <EOL> return '<STR_LIT>' % ( str ( expected ) , str ( actual ) ) <EOL> def are_elements_equal ( expected , actual , comparer = None , message = None ) : <EOL> is_ok = True <EOL> comparer = comparer or default_comparer <EOL> if len ( expected ) != len ( actual ) : <EOL> msg = '<STR_LIT>' % ( len ( expected ) , len ( actual ) ) <EOL> assert False , msg <EOL> return <EOL> for i , ex in enumerate ( expected ) : <EOL> is_ok = comparer ( ex , actual [ i ] ) <EOL> if not is_ok : <EOL> break <EOL> assert is_ok , message or create_message ( actual , expected ) <EOL> def assert_equal ( expected , * actual ) : <EOL> actual = list ( actual ) <EOL> return are_elements_equal ( expected , actual , default_comparer ) <EOL> class AssertList ( list ) : <EOL> def assert_equal ( self , * expected ) : <EOL> expected = list ( expected ) <EOL> return are_elements_equal ( expected , self , default_comparer ) </s>
