Skip to content

Commit

Permalink
fix(api): Fixes bug in replacing substring of old p50 pipettes writte…
Browse files Browse the repository at this point in the history
…n with v13 instead of v1.3 (#1717)
  • Loading branch information
andySigler authored Jun 18, 2018
1 parent 295940e commit 1322055
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api/opentrons/drivers/smoothie_drivers/driver_3_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def read_pipette_model(self, mount):
# Backward compatibility for pipettes programmed with model
# strings that did not include the "." to seperate version
# major and minor values
res = res.replace('_v13', 'v1.3')
res = res.replace('_v13', '_v1.3')

return res

Expand Down
20 changes: 20 additions & 0 deletions api/tests/opentrons/drivers/test_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,26 @@ def _new_send_message(self, command, timeout=None):
driver._send_command = types.MethodType(_old_send_command, driver)


def test_read_pipette_v13(model):
import types
from opentrons.drivers.smoothie_drivers.driver_3_0 import \
_byte_array_to_hex_string

driver = model.robot._driver
_old_send_command = driver._send_command
driver.simulating = False

def _new_send_message(self, command, timeout=None):
return 'L:' + _byte_array_to_hex_string(b'p300_single_v13')

driver._send_command = types.MethodType(_new_send_message, driver)

res = driver.read_pipette_model('left')
assert res == 'p300_single_v1.3'

driver._send_command = types.MethodType(_old_send_command, driver)


def test_fast_home(model):
import types
driver = model.robot._driver
Expand Down

0 comments on commit 1322055

Please sign in to comment.