Skip to content

Commit

Permalink
Fixing results not completed
Browse files Browse the repository at this point in the history
  • Loading branch information
NischalQuTech committed Jan 8, 2024
1 parent 3aa2342 commit 0cca8ef
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tests/util/api/test_remote_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,16 @@ def test_get_results_not_completed(
) -> None:
backend = RemoteBackend()
jobs_api_instance = AsyncMock()
jobs = MagicMock()
jobs.status = JobStatus.RUNNING
jobs_api_instance.read_job_jobs_id_get.return_value = jobs
job = MagicMock()
job.id = 1
job.status = JobStatus.RUNNING
jobs_api_instance.read_job_jobs_id_get.return_value = job

results_api_instance = AsyncMock()

mocker.patch("quantuminspire.util.api.remote_backend.JobsApi", return_value=jobs_api_instance)
backend.get_results(1)
mocker.patch("quantuminspire.util.api.remote_backend.ResultsApi", return_value=results_api_instance)
backend.get_results(job.id)
api_client.assert_has_calls([call().__aenter__(), call().__aexit__(None, None, None)])
jobs_api_instance.read_job_jobs_id_get.assert_called_with(job.id)
results_api_instance.read_results_by_job_id_results_job_job_id_get.assert_not_called()

0 comments on commit 0cca8ef

Please sign in to comment.