#NEWLINE# def test_distinct_key_selector_all_distinct( self ) : #NEWLINE# #INDENT# scheduler = TestScheduler ( ) #NEWLINE# xs = scheduler . create_hot_observable ( on_next ( 280 , 8 ) , on_next ( 300 , 4 ) , on_next ( 350 , 2 ) , on_next ( 380 , 6 ) , on_next ( 400 , 10 ) , on_completed ( 420 ) ) #NEWLINE# def create( ) : #NEWLINE# #INDENT# def key_selector( x ) : #NEWLINE# #INDENT# return ( x / 2 ) #NEWLINE# #UNINDENT# return xs . distinct ( key_selector ) #NEWLINE# #UNINDENT# results = scheduler . start ( create ) #NEWLINE# results . messages . assert_equal ( on_next ( 280 , 8 ) , on_next ( 300 , 4 ) , on_next ( 350 , 2 ) , on_next ( 380 , 6 ) , on_next ( 400 , 10 ) , on_completed ( 420 ) ) #NEWLINE# xs . subscriptions . assert_equal ( subscribe ( 200 , 420 ) )