#NEWLINE# def test_paused_with_observable_controller_and_pause_and_unpause( self ) : #NEWLINE# #INDENT# subscription = [ None ] #NEWLINE# scheduler = TestScheduler ( ) #NEWLINE# results = scheduler . create_observer ( ) #NEWLINE# xs = scheduler . create_hot_observable ( on_next ( 150 , 1 ) , on_next ( 210 , 2 ) , on_next ( 230 , 3 ) , on_next ( 270 , 4 ) , on_next ( 301 , 5 ) , on_next ( 350 , 6 ) , on_next ( 450 , 7 ) , on_completed ( 500 ) ) #NEWLINE# controller = scheduler . create_hot_observable ( on_next ( 201 , True ) , on_next ( 220 , False ) , on_next ( 250 , True ) ) #NEWLINE# pausable = xs . pausable ( controller ) #NEWLINE# def action1( scheduler , state ) : #NEWLINE# #INDENT# subscription [ 0 ] = pausable . subscribe ( results ) #NEWLINE# #UNINDENT# scheduler . schedule_absolute ( 200 , action1 ) #NEWLINE# def action2( scheduler , state ) : #NEWLINE# #INDENT# pausable . pause ( ) #NEWLINE# #UNINDENT# scheduler . schedule_absolute ( 300 , action2 ) #NEWLINE# def action3( scheduler , state ) : #NEWLINE# #INDENT# pausable . resume ( ) #NEWLINE# #UNINDENT# scheduler . schedule_absolute ( 400 , action3 ) #NEWLINE# def action4( scheduler , state ) : #NEWLINE# #INDENT# subscription [ 0 ] . dispose ( ) #NEWLINE# #UNINDENT# scheduler . schedule_absolute ( 1000 , self ) #NEWLINE# scheduler . start ( ) #NEWLINE# results . messages . assert_equal ( on_next ( 210 , 2 ) , on_next ( 270 , 4 ) , on_next ( 450 , 7 ) , on_completed ( 500 ) )