def test_serialize(self): task = TranscriptionTaskFactory() with patch.object(transcribe.TranscribePageTask, "to_dict"): with patch.object(transcribe.TranscribePageTask, "from_dict"): d = task.to_dict() deserialized = TranscriptionTask.from_dict(d) assert deserialized.name == task.name assert len(deserialized.children) == len(task.children)
def test_submit(self): task = TranscriptionTaskFactory() with patch.object(transcribe.TranscribePageTask, "submit"): task.submit(layout_id="foo") for child in task.children: child.submit.assert_called_with(layout_id="foo")