Skip to content

Commit

Permalink
extra test on relay
Browse files Browse the repository at this point in the history
  • Loading branch information
marcaurele committed Dec 12, 2019
1 parent 7f07047 commit e485c11
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_ipx800.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,13 @@ def test_relay_off(self, mock_request):

ipx = ipx800("http://192.0.2.4")
assert ipx.relays[1].off()

@patch("requests.get")
def test_relay_error(self, mock_request):
mock_request.return_value = self._mock_response(
json_file="tests/error.json"
)

ipx = ipx800("http://192.0.2.4")
with self.assertRaises(ApiError):
ipx.relays[3].on()

0 comments on commit e485c11

Please sign in to comment.