示例#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)
示例#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)
示例#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)
示例#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)
示例#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')
示例#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')