Skip to content

Commit

Permalink
Merge pull request #754 from gpiozero/coverage_bump
Browse files Browse the repository at this point in the history
Small coverage bump and fix a couple of bugs
  • Loading branch information
bennuttall committed Sep 23, 2019
2 parents 94d89bf + 2d248d3 commit b396443
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions gpiozero/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
EnergenieBadSocket,
EnergenieBadInitialValue,
OutputDeviceBadValue,
CompositeDeviceBadDevice,
)
from .input_devices import Button
from .output_devices import (
Expand Down
12 changes: 6 additions & 6 deletions tests/test_boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,6 @@ def test_led_board_pwm_init(mock_factory, pwm):
assert isinstance(board[2], PWMLED)
assert [b.pin for b in board] == pins

def test_led_bar_graph_bad_init(mock_factory):
with pytest.raises(GPIOPinMissing):
LEDBarGraph()
with pytest.raises(GPIOPinMissing):
LEDBarGraph(pwm=True)

def test_led_board_on_off(mock_factory):
pin1 = mock_factory.pin(2)
pin2 = mock_factory.pin(3)
Expand Down Expand Up @@ -678,12 +672,18 @@ def test_led_bar_graph_bad_init(mock_factory):
pin1 = mock_factory.pin(2)
pin2 = mock_factory.pin(3)
pin3 = mock_factory.pin(4)
with pytest.raises(GPIOPinMissing):
LEDBarGraph()
with pytest.raises(GPIOPinMissing):
LEDBarGraph(pwm=True)
with pytest.raises(TypeError):
LEDBarGraph(2, 3, foo=4)
with pytest.raises(ValueError):
LEDBarGraph(2, 3, 4, initial_value=-2)
with pytest.raises(ValueError):
LEDBarGraph(2, 3, 4, initial_value=2)
with pytest.raises(ValueError):
LEDBarGraph(2, LEDBoard(3, 4))

def test_led_bar_graph_initial_value(mock_factory):
pin1 = mock_factory.pin(2)
Expand Down

0 comments on commit b396443

Please sign in to comment.