Skip to content

Commit

Permalink
skipped test batch add job is back
Browse files Browse the repository at this point in the history
  • Loading branch information
Mildophin committed Jul 26, 2023
1 parent db94b48 commit a9fb1ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
3 changes: 0 additions & 3 deletions pasqal_cloud/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,10 @@ def _build_ordered_jobs(cls, values: Dict[str, Any]) -> Dict[str, Any]:
to keep the jobs ordered by creation time.
"""
ordered_jobs_list = []

jobs_received = values.get("jobs", [])

for job in jobs_received:
job_dict = {**job, "_client": values["_client"]}
ordered_jobs_list.append(job_dict)

values["ordered_jobs"] = ordered_jobs_list
return values

Expand Down
11 changes: 3 additions & 8 deletions tests/test_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,30 +85,25 @@ def test_create_batch_and_wait(self, request_mock, wait, fetch_results):
assert self.job_id == job_id
assert job.result == self.job_result
assert job.full_result == self.job_full_result
assert len(batch.jobs) == len(batch.ordered_jobs)
assert request_mock.last_request.method == "GET"

def test_get_batch(self, batch):
batch_requested = self.sdk.get_batch(batch.id)
assert batch_requested.id == self.batch_id

@pytest.mark.skip(reason="Not enabled during Iroise MVP")
def test_batch_add_job(self, request_mock):
job = {
"runs": self.n_job_runs,
"variables": self.job_variables,
}
batch = self.sdk.create_batch(
serialized_sequence=self.pulser_sequence,
jobs=[job],
)
assert len(batch.ordered_jobs) == 1
assert len(batch.jobs) == 1
job = batch.add_job(
runs=self.n_job_runs,
variables=self.job_variables,
)
assert request_mock.last_request.json()["batch_id"] == batch.id
assert job.batch_id == batch.id
assert len(batch.jobs) == 2
assert job.runs == self.n_job_runs

@pytest.mark.skip(reason="Not enabled during Iroise MVP")
def test_batch_add_job_and_wait_for_results(self, request_mock):
Expand Down

0 comments on commit a9fb1ff

Please sign in to comment.