#NEWLINE# def test_relay_is_tried_on_bad_connect( t = Time , logic = DEFAULT_LOGIC , bear = NID ( 'bear:987' ) , mouse = NID ( 'mouse:123' ) ) : #NEWLINE# #INDENT# ( t , logic , msg ) = ( t ( ) , logic ( ) , object ( ) ) #NEWLINE# just_ ( logic . new_relay_received ( bear ) ) #NEWLINE# emits_ ( logic . ensure_connected ( mouse , t . current ) , [ ( Connect , nid2addr ( mouse ) ) , ( Ping , OUT , mouse , ANY ) ] ) #NEWLINE# emits_ ( logic . heartbeat ( t . advance ( logic . heartbeat_max_silence ) ) , [ ( RelayConnect , OUT , bear , mouse ) , ( Disconnect , nid2addr ( logic ) ) , ( NextBeat , 1.0 ) ] ) #NEWLINE# return ( t , logic )