def test_receive(self): class MessageStub: body = json.dumps(self.all_dict) workitem = receive(MessageStub()) self.assertEquals(self.all_dict, workitem.to_dict)
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()