Skip to content

Commit

Permalink
Add test for experiment_type setter
Browse files Browse the repository at this point in the history
  • Loading branch information
nayan2167 committed Nov 2, 2023
1 parent 657eb1c commit af2eaee
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/framework/test_composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,21 @@ def test_roundtrip_serializable(self):

self.assertRoundTripSerializable(exp)

def test_experiment_type(self):
"""Test experiment_type setter."""

exp1 = FakeExperiment([0])

par_exp1 = ParallelExperiment([exp1], flatten_results=False)
batch_exp1 = BatchExperiment([exp1], flatten_results=False)
self.assertEqual(par_exp1.experiment_type, "ParallelExperiment")
self.assertEqual(batch_exp1.experiment_type, "BatchExperiment")

par_exp2 = ParallelExperiment([exp1], flatten_results=False, experiment_type="yooo")
batch_exp2 = BatchExperiment([exp1], flatten_results=False, experiment_type="blaaa")
self.assertEqual(par_exp2.experiment_type, "yooo")
self.assertEqual(batch_exp2.experiment_type, "blaaa")


@ddt
class TestCompositeExperimentData(QiskitExperimentsTestCase):
Expand Down

0 comments on commit af2eaee

Please sign in to comment.