#NEWLINE# def test_bind_with_cb( self ) : #NEWLINE# #INDENT# w = mock ( ) #NEWLINE# expect ( self . klass . allow_nowait ) . returns ( True ) #NEWLINE# expect ( mock ( rabbit_connection , 'Writer' ) ) . returns ( w ) #NEWLINE# expect ( w . write_short ) . args ( 't' ) . returns ( w ) #NEWLINE# expect ( w . write_shortstr ) . args ( 'destination' ) . returns ( w ) #NEWLINE# expect ( w . write_shortstr ) . args ( 'source' ) . returns ( w ) #NEWLINE# expect ( w . write_shortstr ) . args ( 'route' ) . returns ( w ) #NEWLINE# expect ( w . write_bit ) . args ( False ) . returns ( w ) #NEWLINE# expect ( w . write_table ) . args ( 'table' ) #NEWLINE# expect ( self . klass . channel . add_synchronous_cb ) . args ( self . klass . _recv_bind_ok ) #NEWLINE# expect ( mock ( rabbit_connection , 'MethodFrame' ) ) . args ( 42 , 40 , 30 , w ) . returns ( 'frame' ) #NEWLINE# expect ( self . klass . send_frame ) . args ( 'frame' ) #NEWLINE# self . klass . bind ( 'destination' , 'source' , routing_key = 'route' , ticket = 't' , arguments = 'table' , cb = 'foo' ) #NEWLINE# assert_equals ( deque ( [ 'foo' ] ) , w . klass . _bind_cb )