Skip to content

Commit

Permalink
cover successful case
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewChubatiuk authored and eradman committed May 2, 2024
1 parent fb35930 commit 26cc1b9
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/serializers/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,26 @@ def test_serializes_job_with_dict_that_contains_error_in_result(self):
}
},
)

def test_serializes_job_with_dict_that_finished_successfully(self):
job = MagicMock()
job.id = 0
job.is_started = False
job.get_status = MagicMock(return_value=JobStatus.FINISHED)
result = MagicMock()
result.type = Result.Type.SUCCESSFUL
result.return_value = 1
job.latest_result = MagicMock(return_value=result)
result = serialize_job(job)
self.assertDictEqual(
result,
{
"job": {
"id": 0,
"updated_at": 0,
"status": JobStatus.FINISHED,
"error": None,
"result_id": 1,
}
},
)

0 comments on commit 26cc1b9

Please sign in to comment.