#NEWLINE# @ inlineCallbacks #NEWLINE# def test_example( self ) : #NEWLINE# #INDENT# "\n        An example test. Note that test functions must start with 'test_'\n        to be recognized by the test framework.\n        " #NEWLINE# channel = self . channel #NEWLINE# ( yield self . exchange_declare ( channel , 0 , 'test' , 'direct' ) ) #NEWLINE# ( yield self . queue_declare ( channel , queue = 'test-queue' ) ) #NEWLINE# ( yield channel . queue_bind ( queue = 'test-queue' , exchange = 'test' , routing_key = 'key' ) ) #NEWLINE# reply = ( yield channel . basic_consume ( queue = 'test-queue' ) ) #NEWLINE# queue = ( yield self . client . queue ( reply . consumer_tag ) ) #NEWLINE# body = 'Hello World!' #NEWLINE# channel . basic_publish ( exchange = 'test' , routing_key = 'key' , content = Content ( body ) ) #NEWLINE# msg = ( yield queue . get ( timeout = 10 ) ) #NEWLINE# self . assertEqual ( body , msg . content . body ) #NEWLINE# channel . basic_ack ( msg . delivery_tag , True )