#NEWLINE# def test_declare_with_args( self ) : #NEWLINE# #INDENT# w = mock ( ) #NEWLINE# stub ( self . klass . allow_nowait ) #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 ( w ) #NEWLINE# expect ( w . write_shortstr ) . args ( 'topic' ) . returns ( w ) #NEWLINE# expect ( w . write_bits ) . args ( 'p' , 'd' , False , False , False ) . returns ( self ) #NEWLINE# expect ( w . write_table ) . args ( 'table' ) #NEWLINE# expect ( mock ( exchange_class , 'MethodFrame' ) ) . args ( 42 , 40 , 10 , w ) . returns ( 'frame' ) #NEWLINE# expect ( self . klass . send_frame ) . args ( 'frame' ) #NEWLINE# expect ( self . klass . channel . add_synchronous_cb ) . args ( self . klass . _recv_declare_ok ) #NEWLINE# self . klass . declare ( 'exchange' , 'topic' , passive = 'p' , durable = 'd' , nowait = False , arguments = 'table' , ticket = 't' ) #NEWLINE# assert_equals ( deque ( [ None ] ) , self . klass . _declare_cb )