Beispiel #1
0
    def test_all_combinations_zero_padded():
        import itertools
        cards = range(5)
        inputs = range(1, 15)
        outputs = range(1, 49)

        for card, in_port, out_port in itertools.product(cards, inputs,
                                                         outputs):
            padded = f'{card:01d}{in_port:02d}{out_port:02d}'

            assert {(in_port, out_port)} == KeysightB220X.parse_channel_list(
                padded)
def uut():
    try:
        resource_name = 'insert_Keysight_B2200_VISA_resource_name_here'
        instance = KeysightB220X('switch_matrix', address=resource_name)
    except (ValueError, VisaIOError):
        # Either there is no VISA lib installed or there was no real
        # instrument found at the specified address => use simulated instrument
        import qcodes.instrument.sims as sims
        path_to_yaml = sims.__file__.replace('__init__.py',
                                             'keysight_b220x.yaml')

        instance = KeysightB220X('switch_matrix',
                                 address='GPIB::1::INSTR',
                                 visalib=path_to_yaml + '@sim')

    instance.get_status()
    instance.clear_status()
    instance.reset()

    yield instance

    instance.close()
Beispiel #3
0
 def test_parse_channel_list():
     channel_list = '(@10101,10202)'
     assert {(1, 1), (2, 2)} == KeysightB220X.parse_channel_list(
         channel_list)