Skip to content

Commit

Permalink
test update
Browse files Browse the repository at this point in the history
  • Loading branch information
bharat-thotakura committed Oct 13, 2023
1 parent 6d674f2 commit 60c6030
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions qiskit-superstaq/qiskit_superstaq/superstaq_job_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ def test_index_compiled_circuits(backend: qss.SuperstaqBackend) -> None:
assert job.compiled_circuits(0).metadata == {"test_label": "test_data"}
mocked_get_job.assert_called_once()

# After fetching the job info once it shouldn't be refreshed again (so no need to mock)
assert job.compiled_circuits() == [single_qc]
assert job.compiled_circuits()[0].metadata == {"test_label": "test_data"}
assert job.compiled_circuits(index=0) == single_qc
assert job.compiled_circuits(0).metadata == {"test_label": "test_data"}

job = qss.SuperstaqJob(backend=backend, job_id="123abc,456xyz,789cba")
with mock.patch(
"general_superstaq.superstaq_client._SuperstaqClient.get_job", return_value=response
Expand All @@ -233,6 +239,13 @@ def test_index_compiled_circuits(backend: qss.SuperstaqBackend) -> None:
assert job.compiled_circuits(index=2).metadata == {"test_label": "test_data"}
mocked_get_job.assert_called_once()

# After fetching the job info once it shouldn't be refreshed again (so no need to mock)
assert job.compiled_circuits() == qc_list
assert job.compiled_circuits(index=2) == single_qc
for circ in job.compiled_circuits():
assert circ.metadata == {"test_label": "test_data"}
assert job.compiled_circuits(index=2).metadata == {"test_label": "test_data"}


def test_input_circuits(backend: qss.SuperstaqBackend) -> None:
response = mock_response("Queued")
Expand Down

0 comments on commit 60c6030

Please sign in to comment.