5 def test_gas_setup(GPIO
, smbus
):
6 from enviroplus
import gas
12 def test_gas_read_all(GPIO
, smbus
):
13 from enviroplus
import gas
15 result
= gas
.read_all()
17 assert type(result
.oxidising
) == float
18 assert int(result
.oxidising
) == 16641
20 assert type(result
.reducing
) == float
21 assert int(result
.reducing
) == 16727
23 assert type(result
.nh3
) == float
24 assert int(result
.nh3
) == 16813
26 assert "Oxidising" in str(result
)
29 def test_gas_read_each(GPIO
, smbus
):
30 from enviroplus
import gas
33 assert int(gas
.read_oxidising()) == 16641
34 assert int(gas
.read_reducing()) == 16727
35 assert int(gas
.read_nh3()) == 16813
38 def test_gas_read_adc(GPIO
, smbus
):
39 from enviroplus
import gas
43 gas
.set_adc_gain(2.048)
44 assert gas
.read_adc() == 0.255
47 def test_gas_read_adc_default_gain(GPIO
, smbus
):
48 from enviroplus
import gas
52 assert gas
.read_adc() == 0.255
55 def test_gas_read_adc_str(GPIO
, smbus
):
56 from enviroplus
import gas
60 gas
.set_adc_gain(2.048)
61 assert 'ADC' in str(gas
.read_all())