Skip to content

Commit

Permalink
CI: Fix tests and command encoding bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed Dec 5, 2023
1 parent 85fe89a commit 00224ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pa1010d/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def send_command(self, command, add_checksum=True):
If add_checksum is True (the default) a NMEA checksum will automatically be computed and added.
"""
if isinstance(command, bytes):
if not isinstance(command, bytes):
command = command.encode("ascii")

# TODO replace with pynmea2 functionality
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ def write_byte(self, address, data):
def smbus():
smbus = mock.MagicMock()
smbus.SMBus = SMBus
sys.modules["smbus"] = smbus
sys.modules["smbus2"] = smbus
yield smbus
del sys.modules["smbus"]
del sys.modules["smbus2"]

0 comments on commit 00224ee

Please sign in to comment.