From 8ca95c53048c3069ba4119ca39fdb45cada52792 Mon Sep 17 00:00:00 2001 From: merav-aharoni Date: Mon, 16 Oct 2023 12:28:53 +0000 Subject: [PATCH] Fixed several tests --- test/integration/test_ibm_job.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/integration/test_ibm_job.py b/test/integration/test_ibm_job.py index bbd3fb784..7598accda 100644 --- a/test/integration/test_ibm_job.py +++ b/test/integration/test_ibm_job.py @@ -33,7 +33,6 @@ from ..decorators import ( IntegrationTestDependencies, integration_test_setup_with_backend, - production_only, ) from ..fake_account_client import BaseFakeAccountClient, CancelableFakeJob from ..ibm_test_case import IBMTestCase @@ -156,9 +155,8 @@ def test_retrieve_pending_jobs(self): def test_retrieve_job(self): """Test retrieving a single job.""" retrieved_job = self.service.job(self.sim_job.job_id()) - print(retrieved_job.result()._metadata) self.assertEqual(self.sim_job.job_id(), retrieved_job.job_id()) - self.assertEqual(self.sim_job.circuits(), retrieved_job.circuits()) + self.assertEqual(self.sim_job.inputs["circuits"], retrieved_job.inputs["circuits"]) self.assertEqual(self.sim_job.result().get_counts(), retrieved_job.result().get_counts()) def test_retrieve_job_uses_appropriate_backend(self): @@ -292,6 +290,8 @@ def test_retrieve_jobs_order(self): ) self.assertNotIn(job.job_id(), [rjob.job_id() for rjob in oldest_jobs]) + + @skip("how do we support refresh") def test_refresh_job_result(self): """Test re-retrieving job result via refresh.""" result = self.sim_job.result() @@ -416,7 +416,7 @@ def _side_effect(self, *args, **kwargs): def test_job_circuits(self): """Test job circuits.""" - self.assertEqual(str(self.bell), str(self.sim_job.circuits()[0])) + self.assertEqual(str(self.bell), str(self.sim_job.inputs["circuits"][0])) def test_job_backend_options(self): """Test job backend options.""" @@ -428,8 +428,8 @@ def test_job_header(self): """Test job header.""" custom_header = {"test": "test_job_header"} job = self.sim_backend.run(self.bell, header=custom_header) - self.assertEqual(custom_header["test"], job.header()["test"]) - self.assertLessEqual(custom_header.items(), job.header().items()) + self.assertEqual(custom_header["test"], job.inputs["header"]["test"]) + self.assertLessEqual(custom_header.items(), job.inputs["header"].items()) def test_lazy_loading_params(self): """Test lazy loading job params.""" @@ -438,4 +438,4 @@ def test_lazy_loading_params(self): rjob = self.service.job(job.job_id()) self.assertFalse(rjob._params) - self.assertTrue(rjob.circuits) + self.assertTrue(rjob.inputs["circuits"])