From a2110b44c00766cf7e11b81c889d3141287202e7 Mon Sep 17 00:00:00 2001 From: Serwan Asaad Date: Fri, 12 Apr 2024 15:12:56 +0200 Subject: [PATCH] test: add test to ensure singlechannel is instantiated properly --- tests/components/channels/test_single_channel.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/components/channels/test_single_channel.py b/tests/components/channels/test_single_channel.py index a19b6022..3b91ac6c 100644 --- a/tests/components/channels/test_single_channel.py +++ b/tests/components/channels/test_single_channel.py @@ -1,4 +1,5 @@ import pytest +import json from copy import deepcopy from quam.components import * @@ -136,3 +137,16 @@ def test_single_channel_set_dc_offset(mocker): set_dc_offset.assert_called_once_with( element="channel", element_input="single", offset=0.5 ) + + +def test_instantiate_single_channel(): + from quam.core.quam_instantiation import instantiate_quam_class + + channel = SingleChannel(opx_output=("con1", 1)) + d = channel.to_dict() + + d_json = json.dumps(d) + + d_loaded = json.loads(d_json) + + instantiate_quam_class(SingleChannel, d_loaded)