From ceba7c01de38e5b376de3ef859207995547e583d Mon Sep 17 00:00:00 2001 From: ItamarGoldman Date: Mon, 13 Nov 2023 10:44:43 +0200 Subject: [PATCH] Added test to check that the provider is copied --- test/database_service/test_db_experiment_data.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/database_service/test_db_experiment_data.py b/test/database_service/test_db_experiment_data.py index 3d83fa8512..070b32291c 100644 --- a/test/database_service/test_db_experiment_data.py +++ b/test/database_service/test_db_experiment_data.py @@ -14,6 +14,7 @@ """Test ExperimentData.""" from test.base import QiskitExperimentsTestCase +from test.fake_experiment import FakeExperiment import os from unittest import mock import copy @@ -46,6 +47,7 @@ ExperimentStatus, ) from qiskit_experiments.framework.matplotlib import get_non_gui_ax +from qiskit_experiments.test.fake_backend import FakeBackend class TestDbExperimentData(QiskitExperimentsTestCase): @@ -1044,7 +1046,7 @@ def test_additional_attr(self): def test_copy_metadata(self): """Test copy metadata.""" - exp_data = ExperimentData(experiment_type="qiskit_test") + exp_data = FakeExperiment(experiment_type="qiskit_test").run(backend=FakeBackend()) exp_data.add_data(self._get_job_result(1)) result = mock.MagicMock() result.result_id = str(uuid.uuid4()) @@ -1052,6 +1054,7 @@ def test_copy_metadata(self): copied = exp_data.copy(copy_results=False) self.assertEqual(exp_data.data(), copied.data()) self.assertFalse(copied.analysis_results()) + self.assertEqual(exp_data.provider, copied.provider) def test_copy_metadata_pending_job(self): """Test copy metadata with a pending job."""