larsks / tm-v71-tools

GNU General Public License v3.0
5 stars 2 forks source link

Use a fake serial port instead of mocking api functions #3

Closed larsks closed 5 years ago

larsks commented 5 years ago

Instead of mocking out write_bytes, read_bytes, and read_line, we use a fake serial port implementation that uses a pair of io.BytesIO objects. This means we're actually running the send_bytes, etc, methods, rather than excluding them from testing via mocks.