Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
WillB97 committed Aug 5, 2024
1 parent 83f9110 commit 2d53cd8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def query(self, request: str) -> str:
"""
# Assert that we have not run out of responses
# and that the request is the next one we expect
assert self.request_index < len(self.responses)
assert self.request_index < len(self.responses), f"Unexpected request: {request}"
assert request == self.responses[self.request_index][0]

# Fetch the response and increment the request index
Expand Down
6 changes: 0 additions & 6 deletions tests/test_arduino.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,8 @@ def test_arduino_pins(arduino_serial: MockArduino) -> None:

# Test that we can get the analog value of a pin
arduino_serial.serial_wrapper._add_responses([
("PIN:2:MODE:GET?", "OUTPUT"), # mode is read before analog value
("PIN:2:MODE:GET?", "OUTPUT"),
("PIN:10:MODE:GET?", "INPUT"),
("PIN:14:MODE:GET?", "INPUT"),
("PIN:14:ANALOG:GET?", "1000"),
])
with pytest.raises(IOError, match=r"Analog read is not supported.*"):
arduino.pins[2].analog_value
with pytest.raises(IOError, match=r"Pin does not support analog read"):
arduino.pins[10].analog_value
# 4.888 = round((5 / 1023) * 1000, 3)
Expand Down

0 comments on commit 2d53cd8

Please sign in to comment.