Пример #1
0
def test_revert_all_no_default():
    interface = Interface()
    interface.configure({}, registry_config)
    initial_value = interface.get_point("FloatNoDefault")
    
    scrape_values = interface.scrape_all()
    
    assert scrape_values["FloatNoDefault"] == initial_value
    
    test_value = initial_value + 1.0
    
    interface.set_point("FloatNoDefault", test_value)
    temp_value = interface.get_point("FloatNoDefault")
    assert temp_value == test_value
    
    interface.revert_all()
    temp_value = interface.get_point("FloatNoDefault")
    assert temp_value == initial_value
    
    #Do it twice to make sure it restores state after revert
    interface.set_point("FloatNoDefault", test_value)
    temp_value = interface.get_point("FloatNoDefault")
    assert temp_value == test_value
    
    interface.revert_all()
    temp_value = interface.get_point("FloatNoDefault")
    assert temp_value == initial_value
Пример #2
0
def test_revert_all_no_default():
    interface = Interface()
    interface.configure({}, registry_config)
    initial_value = interface.get_point("FloatNoDefault")

    scrape_values = interface.scrape_all()

    assert scrape_values["FloatNoDefault"] == initial_value

    test_value = initial_value + 1.0

    interface.set_point("FloatNoDefault", test_value)
    temp_value = interface.get_point("FloatNoDefault")
    assert temp_value == test_value

    interface.revert_all()
    temp_value = interface.get_point("FloatNoDefault")
    assert temp_value == initial_value

    #Do it twice to make sure it restores state after revert
    interface.set_point("FloatNoDefault", test_value)
    temp_value = interface.get_point("FloatNoDefault")
    assert temp_value == test_value

    interface.revert_all()
    temp_value = interface.get_point("FloatNoDefault")
    assert temp_value == initial_value
Пример #3
0
def test_revert_device():
    interface = Interface()
    interface.configure({}, registry_config)
    value = interface.get_point("Float")
    assert value == 50.0
    
    interface.set_point("Float", 25.0)
    value = interface.get_point("Float")
    assert value == 25.0
    
    interface.revert_all()
    value = interface.get_point("Float")
    assert value == 50.0
Пример #4
0
def test_revert_device():
    interface = Interface()
    interface.configure({}, registry_config)
    value = interface.get_point("Float")
    assert value == 50.0

    interface.set_point("Float", 25.0)
    value = interface.get_point("Float")
    assert value == 25.0

    interface.revert_all()
    value = interface.get_point("Float")
    assert value == 50.0