def test_serialize_pickle(self): worker_task1 = WorkerTask('id-1', None, 'default', dummy_function, [], {'object': TestObject()}, 5, 0, None, True) msg = worker_task1.serialize() worker_task2 = WorkerTask.deserialize(msg) self.assertEqual(worker_task2.args, worker_task1.args) self.assertEqual(worker_task2.kwargs['object'].message, worker_task1.kwargs['object'].message)
def test_serialize_pickle(self): worker_task1 = WorkerTask('id-1', None, 'default', dummy_function, [], {'object': TestObject()}, 5, 0, None, True) msg = worker_task1.serialize() worker_task2 = WorkerTask.deserialize(msg) self.assertEqual(worker_task2.args, worker_task1.args) self.assertEqual(worker_task2.kwargs['object'].message, worker_task1.kwargs['object'].message)
def test_serialize_worker_task(self): worker_task = WorkerTask('id-1', 'group-5', 'default', dummy_function, [], {}, 5, 0, 'retry-uuid', False) msg = worker_task.serialize() self.assertDictEqual(json.loads(msg), json.loads(self.dummy_msg))
def test_serialize_worker_task(self): worker_task = WorkerTask('id-1', 'group-5', 'default', dummy_function, [], {}, 5, 0, 'retry-uuid', False) msg = worker_task.serialize() self.assertEqual(msg, self.dummy_msg)