Skip to content

Commit be63866

Browse files
committed
Test read_all throws exception when unavailable
1 parent 18f582c commit be63866

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

library/tests/test_setup.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import pytest
2+
3+
14
def test_gas_setup(GPIO, smbus):
25
from enviroplus import gas
36
gas._is_setup = False
@@ -11,6 +14,9 @@ def test_gas_unavailable(GPIO, mocksmbus):
1114
gas._is_setup = False
1215
assert gas.available() == False
1316

17+
with pytest.raises(RuntimeError):
18+
gas.read_all()
19+
1420

1521
def test_gas_available(GPIO, mocksmbus):
1622
from enviroplus import gas

0 commit comments

Comments
 (0)