#NEWLINE# def test_min_by_comparer_throw( self ) : #NEWLINE# #INDENT# ex = 'ex' #NEWLINE# scheduler = TestScheduler ( ) #NEWLINE# msgs = [ on_next ( 150 , { #NEWLINE# #INDENT# 'key' : 1 , #NEWLINE# 'value' : 'z' , #NEWLINE# #UNINDENT# } ) , on_error ( 210 , ex ) ] #NEWLINE# def reverse_comparer( a , b ) : #NEWLINE# #INDENT# if ( a > b ) : #NEWLINE# #INDENT# return ( - 1 ) #NEWLINE# #UNINDENT# if ( a == b ) : #NEWLINE# #INDENT# return 0 #NEWLINE# #UNINDENT# return 1 #NEWLINE# #UNINDENT# def create( ) : #NEWLINE# #INDENT# return xs . min_by ( ( lambda x : x [ 'key' ] ) , reverse_comparer ) #NEWLINE# #UNINDENT# xs = scheduler . create_hot_observable ( msgs ) #NEWLINE# res = scheduler . start ( create = create ) . messages #NEWLINE# res . assert_equal ( on_error ( 210 , ex ) )