From f492c36c4a90e0ff3d02af5c27a1ecbfcefb9ba8 Mon Sep 17 00:00:00 2001 From: Marquess Valdez Date: Thu, 23 May 2024 15:25:12 -0700 Subject: [PATCH] fix fixed-qubit test --- test/unit/__snapshots__/test_quilbase.ambr | 6 ++++++ test/unit/test_quilbase.py | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/test/unit/__snapshots__/test_quilbase.ambr b/test/unit/__snapshots__/test_quilbase.ambr index c7811f422..3c0e9cc1d 100644 --- a/test/unit/__snapshots__/test_quilbase.ambr +++ b/test/unit/__snapshots__/test_quilbase.ambr @@ -138,6 +138,9 @@ # name: TestDeclare.test_str[With-Size] 'DECLARE ro OCTET[5]' # --- +# name: TestDefCalibration.test_out[Fixed-Qubit] + 'DEFCAL Calibrate 0:' +# --- # name: TestDefCalibration.test_out[No-Params] ''' DEFCAL Calibrate 0: @@ -150,6 +153,9 @@ X 0 ''' # --- +# name: TestDefCalibration.test_str[Fixed-Qubit] + 'DEFCAL Calibrate 0:' +# --- # name: TestDefCalibration.test_str[No-Params] ''' DEFCAL Calibrate 0: diff --git a/test/unit/test_quilbase.py b/test/unit/test_quilbase.py index 3839aecf2..68a2ebf93 100644 --- a/test/unit/test_quilbase.py +++ b/test/unit/test_quilbase.py @@ -412,7 +412,9 @@ def test_parameters(self, calibration: DefCalibration, parameters: List[Paramete calibration.parameters = [pi / 2] assert calibration.parameters == [pi / 2] - def test_qubits(self, calibration: DefCalibration, qubits: List[Qubit]): + def test_qubits(self, calibration: DefCalibration, qubits: List[QubitDesignator]): + if len(qubits) > 0 and isinstance(qubits[0], int): + qubits = [Qubit(index) for index in qubits] assert calibration.qubits == qubits calibration.qubits = [Qubit(123)] assert calibration.qubits == [Qubit(123)]