Skip to content

Commit

Permalink
Added test to check that the provider is copied
Browse files Browse the repository at this point in the history
  • Loading branch information
ItamarGoldman committed Nov 13, 2023
1 parent d68a11f commit ceba7c0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/database_service/test_db_experiment_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -1044,14 +1046,15 @@ 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())
exp_data.add_analysis_results(result)
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."""
Expand Down

0 comments on commit ceba7c0

Please sign in to comment.