def _callback(ch, method, properties, body): ch.basic_ack(delivery_tag = method.delivery_tag) data = json.loads(body.decode('ascii')) received_job = Job.from_json(data['body']) channel.stop_consuming() received_job.timestamp = job.timestamp assert str(job) == str(received_job)
def test_from_json(): job = Job.from_json(json_str) job.timestamp = None assert str(job) == json_str