#NEWLINE# def test_delete_with_cb( self ) : #NEWLINE# #INDENT# w = mock ( ) #NEWLINE# expect ( self . klass . allow_nowait ) . returns ( True ) #NEWLINE# expect ( mock ( exchange_class , 'Writer' ) ) . returns ( w ) #NEWLINE# expect ( w . write_short ) . args ( 't' ) . returns ( w ) #NEWLINE# expect ( w . write_shortstr ) . args ( 'exchange' ) . returns ( self ) #NEWLINE# expect ( w . write_bits ) . args ( 'maybe' , False ) #NEWLINE# expect ( mock ( exchange_class , 'MethodFrame' ) ) . args ( 42 , 40 , 20 , w ) . returns ( 'frame' ) #NEWLINE# expect ( self . klass . send_frame ) . args ( 'frame' ) #NEWLINE# expect ( self . klass . channel . add_synchronous_cb ) . args ( self . klass . _recv_delete_ok ) #NEWLINE# self . klass . delete ( 'exchange' , if_unused = 'maybe' , nowait = True , ticket = 't' , cb = 'foo' ) #NEWLINE# assert_equals ( deque ( [ 'foo' ] ) , self . klass . _delete_cb )