|
5 | 5 |
|
6 | 6 |
|
7 | 7 | @pytest.mark.parametrize('config, result', |
8 | | - [(GpioDACConfig, ['dac', 'i2c', 9, 32, 33, '/dev/i2c-10']), |
9 | | - (GpioADCConfig, ['adc', 'i2c', 2, 32, 33, '/dev/i2c-10']), |
10 | | - (GpioRTDConfig, ['rtd', 'i2c', 1, 32, 33, '/dev/i2c-10']), |
11 | | - (GpioLEDConfig, ['led', 'i2c', 8, 32, 33, '/dev/i2c-10']) |
| 8 | + [(GpioConfigs.DAC.value, ['dac', 'i2c', 9, 32, '/dev/i2c-10']), |
| 9 | + (GpioConfigs.ADC.value, ['adc', 'i2c', 2, 33, '/dev/i2c-10']), |
| 10 | + (GpioConfigs.RTD.value, ['rtd', 'i2c', 1, 33, '/dev/i2c-10']), |
| 11 | + (GpioConfigs.LED.value, ['led', 'i2c', 8, 32, '/dev/i2c-10']) |
12 | 12 | ]) |
13 | 13 | def test_GpioModuleConfig(config, result): |
14 | 14 | assert config.name == result[0] |
15 | 15 | assert config.device == result[1] |
16 | 16 | assert config.num_pins == result[2] |
17 | | - assert config.address.EXP_ONE.value == result[3] |
18 | | - assert config.address.EXP_TWO.value == result[4] |
19 | | - assert config.dev_path == result[5] |
| 17 | + assert config.address.value == result[3] |
| 18 | + assert config.dev_path == result[4] |
20 | 19 |
|
21 | 20 | @pytest.mark.parametrize('name, setoutput, clearoutput, address, result', |
22 | 21 | [('AO_EN1', GpioAOutputSet.SET_OUTPUT_1.value, GpioAOutputClear.CLEAR_OUTPUT_1.value, GpioExpanderAddress.EXP_ONE.value, ['AO_EN1', OpCode(1, 2, 0xFE), OpCode(0, 2, 0xFE), 32]), |
|
0 commit comments