コード例 #1
0
 def test_receive(self):        
     class MessageStub:
         body = json.dumps(self.all_dict)
     workitem = receive(MessageStub())
     self.assertEquals(self.all_dict, workitem.to_dict)
コード例 #2
0
 def workitem_callback(self, msg):
     "This is where a workitem message is handled"
     self.workitem = receive(msg)
     self.consume()
     if not self.workitem.forget:
         self.reply_to_engine()