def test_init() -> None:
    manager = AtlasPHManager(
        name="Test",
        i2c_lock=threading.RLock(),
        state=State(),
        config=peripheral_config,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
Exemple #2
0
def test_clear_calibration() -> None:
    manager = AtlasPHManager(
        name="Test",
        i2c_lock=threading.RLock(),
        state=State(),
        config=peripheral_config,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
    manager.initialize_peripheral()
    manager.mode = modes.CALIBRATE
    message, status = manager.create_event(request={"type": events.CLEAR_CALIBRATION})
    assert status == 200
    manager.check_events()
def test_calibrate_high() -> None:
    manager = AtlasPHManager(
        name="Test",
        i2c_lock=threading.RLock(),
        state=State(),
        config=peripheral_config,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
    manager.initialize()
    manager.mode = Modes.CALIBRATE
    message, status = manager.events.create(request={
        "type": "High Point Calibration",
        "value": "10.0"
    })
    assert status == 200
    manager.events.check()