From a9fb1ff3871102ea732b389cb51ed72234bc8bc0 Mon Sep 17 00:00:00 2001 From: Milan Viricel Date: Wed, 26 Jul 2023 16:48:35 +0200 Subject: [PATCH] skipped test batch add job is back --- pasqal_cloud/batch.py | 3 --- tests/test_batch.py | 11 +++-------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/pasqal_cloud/batch.py b/pasqal_cloud/batch.py index 3c814baf..a54f4ddb 100644 --- a/pasqal_cloud/batch.py +++ b/pasqal_cloud/batch.py @@ -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 diff --git a/tests/test_batch.py b/tests/test_batch.py index f00fbf4e..bc286925 100644 --- a/tests/test_batch.py +++ b/tests/test_batch.py @@ -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):