예제 #1
0
def test_init() -> None:
    driver = LEDDAC5578Driver(
        name="Test",
        panel_configs=panel_configs,
        panel_properties=panel_properties,
        i2c_lock=threading.RLock(),
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
def test_init() -> None:
    driver = AdafruitSoilDriver(
        name="Test",
        i2c_lock=threading.RLock(),
        bus=2,
        address=0x77,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
def test_init() -> None:
    manager = ActuatorPCF8574Manager(
        name="Test",
        i2c_lock=threading.RLock(),
        state=State(),
        config=peripheral_config,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
예제 #4
0
def test_disable_salinity_output() -> None:
    driver = AtlasECDriver(
        name="Test",
        i2c_lock=threading.RLock(),
        bus=2,
        address=0x77,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
    driver.disable_salinity_output()
예제 #5
0
def test_reset() -> None:
    driver = SHT25Driver(
        name="Test",
        i2c_lock=threading.RLock(),
        bus=2,
        address=0x77,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
    driver.reset()
예제 #6
0
def test_set_probe_type() -> None:
    driver = AtlasECDriver(
        name="Test",
        i2c_lock=threading.RLock(),
        bus=2,
        address=0x77,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
    driver.set_probe_type(1.0)
예제 #7
0
def test_calibrate_dry() -> None:
    driver = AtlasECDriver(
        name="Test",
        i2c_lock=threading.RLock(),
        bus=2,
        address=0x77,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
    driver.calibrate_dry()
예제 #8
0
def test_init() -> None:
    driver = AtlasDriver(
        name="Test",
        i2c_lock=threading.RLock(),
        bus=2,
        address=0x64,
        simulate=True,
        mux_simulator=MuxSimulator(),
        Simulator=AtlasSimulator,
    )
예제 #9
0
def test_disable_abc_logic() -> None:
    driver = T6713Driver(
        name="Test",
        i2c_lock=threading.RLock(),
        bus=2,
        address=0x77,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
    driver.disable_abc_logic()
def test_peripheral_initialize() -> None:
    manager = ActuatorDAC5578Manager(
        name="Test",
        i2c_lock=threading.RLock(),
        state=State(),
        config=peripheral_config,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
    manager.initialize_peripheral()
def test_init() -> None:
    driver = USBCameraDriver(
        name="Test",
        resolution="640x480",
        vendor_id=0x05A3,
        product_id=0x9520,
        simulate=True,
        mux_simulator=MuxSimulator(),
        i2c_lock=threading.RLock(),
    )
def test_shutdown_peripheral() -> None:
    manager = AtlasPHManager(
        name="Test",
        i2c_lock=threading.RLock(),
        state=State(),
        config=peripheral_config,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
    manager.initialize_peripheral()
    manager.shutdown_peripheral()
예제 #13
0
def test_reset_peripheral() -> None:
    manager = USBCameraManager(
        name="Test",
        i2c_lock=threading.RLock(),
        state=State(),
        config=peripheral_config,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
    manager.initialize_peripheral()
    manager.reset_peripheral()
예제 #14
0
def test_read_ec() -> None:
    driver = AtlasECDriver(
        name="Test",
        i2c_lock=threading.RLock(),
        bus=2,
        address=0x77,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
    ec = driver.read_ec()
    assert ec == 0.0
예제 #15
0
def test_calibrate_single() -> None:
    driver = AtlasECDriver(
        name="Test",
        i2c_lock=threading.RLock(),
        bus=2,
        address=0x77,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
    with pytest.raises(TakeSinglePointCalibrationError):
        driver.calibrate_single(1.413)
예제 #16
0
def test_read_co2() -> None:
    driver = T6713Driver(
        name="Test",
        i2c_lock=threading.RLock(),
        bus=2,
        address=0x77,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
    co2 = driver.read_co2()
    assert co2 == 546.0
def test_init() -> None:
    driver = PCF8574Driver(
        "Test",
        i2c_lock=threading.RLock(),
        bus=2,
        address=0x20,
        mux=0x77,
        channel=4,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
예제 #18
0
def test_peripheral_setup() -> None:
    manager = ActuatorGroveRGBLCDManager(
        name="Test",
        i2c_lock=threading.RLock(),
        state=State(),
        config=peripheral_config,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
    manager.initialize_peripheral()
    manager.setup_peripheral()
예제 #19
0
def test_update_peripheral() -> None:
    manager = AdafruitSoilManager(
        name="Test",
        i2c_lock=threading.RLock(),
        state=State(),
        config=peripheral_config,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
    manager.initialize_peripheral()
    manager.update_peripheral()
def test_read_hardware_id() -> None:
    driver = AdafruitSoilDriver(
        name="Test",
        i2c_lock=threading.RLock(),
        bus=2,
        address=0x77,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
    hardware_id = driver.read_hardware_id()
    assert hardware_id == 4026
def test_init():
    i2c = I2C(
        name="Test",
        i2c_lock=threading.RLock(),
        bus=2,
        address=0x40,
        mux=0x77,
        channel=4,
        mux_simulator=MuxSimulator(),
        PeripheralSimulator=PeripheralSimulator,
    )
예제 #22
0
def test_clear_calibrations() -> None:
    driver = AtlasDriver(
        name="Test",
        i2c_lock=threading.RLock(),
        bus=2,
        address=0x64,
        simulate=True,
        mux_simulator=MuxSimulator(),
        Simulator=AtlasSimulator,
    )
    driver.clear_calibrations()
def test_read_moisture() -> None:
    driver = AdafruitSoilDriver(
        name="Test",
        i2c_lock=threading.RLock(),
        bus=2,
        address=0x77,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
    humidity = driver.read_moisture()
    assert humidity == 1000
예제 #24
0
def test_set_compensation_temperature() -> None:
    driver = AtlasDriver(
        name="Test",
        i2c_lock=threading.RLock(),
        bus=2,
        address=0x64,
        simulate=True,
        mux_simulator=MuxSimulator(),
        Simulator=AtlasSimulator,
    )
    driver.set_compensation_temperature(26.0)
예제 #25
0
def test_read_humidity() -> None:
    driver = SHT25Driver(
        name="Test",
        i2c_lock=threading.RLock(),
        bus=2,
        address=0x77,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
    humidity = driver.read_humidity()
    assert humidity == 70.0
def test_read_temperature() -> None:
    driver = AdafruitSoilDriver(
        name="Test",
        i2c_lock=threading.RLock(),
        bus=2,
        address=0x77,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )

    temperature = driver.read_temperature()
    assert temperature == 24.0
def test_set_high() -> None:
    driver = DAC5578Driver(
        "Test",
        i2c_lock=threading.RLock(),
        bus=2,
        address=0x4C,
        mux=0x77,
        channel=4,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
    driver.set_high()
def test_get_port_status_byte() -> None:
    driver = PCF8574Driver(
        "Test",
        i2c_lock=threading.RLock(),
        bus=2,
        address=0x20,
        mux=0x77,
        channel=4,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
    port_status_byte = driver.get_port_status_byte()
def test_write_register():
    i2c = I2C(
        name="Test",
        i2c_lock=threading.RLock(),
        bus=2,
        address=0x40,
        mux=0x77,
        channel=4,
        mux_simulator=MuxSimulator(),
        PeripheralSimulator=PeripheralSimulator,
    )
    i2c.write_register(0x01, 0x02)
def test_write_output_standard() -> None:
    driver = DAC5578Driver(
        "Test",
        i2c_lock=threading.RLock(),
        bus=2,
        address=0x4C,
        mux=0x77,
        channel=4,
        simulate=True,
        mux_simulator=MuxSimulator(),
    )
    driver.write_output(0, 0)