#NEWLINE# @ mock . patch ( 'eventlet.greenthread.sleep' , autospec = True ) #NEWLINE# def test_power_reset_off_delay_on_delay( self , mock_sleep , mock_get_client ) : #NEWLINE# #INDENT# mock_client = mock_get_client . return_value #NEWLINE# driver = snmp . _get_driver ( self . node ) #NEWLINE# mock_client . get . side_effect = [ driver . value_power_on , driver . value_power_off , driver . value_power_off , driver . value_power_on ] #NEWLINE# pstate = driver . power_reset ( ) #NEWLINE# calls = [ mock . call ( driver . _snmp_oid ( ) , driver . value_power_off ) , mock . call ( driver . _snmp_oid ( ) , driver . value_power_on ) ] #NEWLINE# mock_client . set . assert_has_calls ( calls ) #NEWLINE# calls = ( [ mock . call ( driver . _snmp_oid ( ) ) ] * 4 ) #NEWLINE# mock_client . get . assert_has_calls ( calls ) #NEWLINE# self . assertEqual ( states . POWER_ON , pstate )