Esempio n. 1
0
def test_load_test_instrument():
    config_data = StringIO(u"""
test:
    class: !!python/name:instruments.Instrument
    uri: test://
""")
    insts = load_instruments(config_data)
    assert isinstance(insts['test'], Instrument)
Esempio n. 2
0
def test_load_test_instrument():
    config_data = StringIO(u"""
test:
    class: !!python/name:instruments.Instrument
    uri: test://
""")
    insts = load_instruments(config_data)
    assert isinstance(insts['test'], Instrument)
Esempio n. 3
0
def test_load_test_instrument_subtree():
    config_data = StringIO(u"""
instruments:
    test:
        class: !!python/name:instruments.Instrument
        uri: test://
""")
    insts = load_instruments(config_data, conf_path="/instruments")
    assert isinstance(insts['test'], Instrument)
Esempio n. 4
0
def test_load_test_instrument_subtree():
    config_data = StringIO(u"""
instruments:
    test:
        class: !!python/name:instruments.Instrument
        uri: test://
""")
    insts = load_instruments(config_data, conf_path="/instruments")
    assert isinstance(insts['test'], Instrument)
Esempio n. 5
0
def test_load_test_instrument_setattr():
    config_data = StringIO(u"""
test:
    class: !!python/name:instruments.Instrument
    uri: test://
    attrs:
        foo: !Q 111 GHz
""")
    insts = load_instruments(config_data)
    assert insts['test'].foo == u.Quantity(111, 'GHz')
Esempio n. 6
0
def test_load_test_instrument_setattr():
    config_data = StringIO(u"""
test:
    class: !!python/name:instruments.Instrument
    uri: test://
    attrs:
        foo: !Q 111 GHz
""")
    insts = load_instruments(config_data)
    assert insts['test'].foo == pq.Quantity(111, 'GHz')