Skip to content

Commit

Permalink
fixes tests after merging in edge
Browse files Browse the repository at this point in the history
  • Loading branch information
andySigler committed May 30, 2018
1 parent d1956c4 commit 114b986
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
3 changes: 2 additions & 1 deletion api/opentrons/drivers/smoothie_drivers/driver_3_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from opentrons.drivers import serial_communication
from opentrons.drivers.rpi_drivers import gpio
from opentrons.instruments.pipette_config import configs
'''
- Driver is responsible for providing an interface for motion control
- Driver is the only system component that knows about GCODES or how smoothie
Expand Down Expand Up @@ -371,7 +372,7 @@ def read_pipette_model(self, mount):
:return :dict with key 'model' and model string as value, or None
'''
if self.simulating:
return None
res = list(configs.values())[0].name
else:
res = self._read_from_pipette(
GCODES['READ_INSTRUMENT_MODEL'], mount)
Expand Down
21 changes: 5 additions & 16 deletions api/opentrons/robot/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,27 +905,16 @@ def get_attached_pipettes(self):
'plunger_axis': 'b',
'model': self.model_by_mount['left'],
}
left_model = left_data.get('model')
if left_model:
tip_length = pipette_config.configs[left_model].tip_length
left_data.update({'tip_length': tip_length})

right_data = {
'mount_axis': 'a',
'plunger_axis': 'c',
'model': self.model_by_mount['right']
}

# to allow any model of pipette to be simulated on a robot, pipette
# models below are overwritten while simulating, so regardless of what
# is currently attached/cached, any pipette model can be simulated
if self.is_simulating():
default_version = list(pipette_config.configs.values())[0].name
if not left_data['model']:
left_data['model'] = default_version
if not right_data['model']:
right_data['model'] = default_version

# add tip-length
left_model = left_data.get('model')
if left_model:
tip_length = pipette_config.configs[left_model].tip_length
left_data.update({'tip_length': tip_length})
right_model = right_data.get('model')
if right_model:
tip_length = pipette_config.configs[right_model].tip_length
Expand Down
5 changes: 5 additions & 0 deletions api/tests/opentrons/server/calibration_integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ def dummy_read_model(self, mount):
monkeypatch.setattr(
SmoothieDriver_3_0_0, 'read_pipette_model', dummy_read_model)

def _is_simulating():
return False

monkeypatch.setattr(robot, 'is_simulating', _is_simulating)

robot.reset()
robot.home()

Expand Down
5 changes: 5 additions & 0 deletions api/tests/opentrons/server/test_calibration_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ def uuid_mock():
('p300_multi_v1', None, 'p300_multi_v1'),
('p10_single_v1', 'p300_multi_v1', 'p10_single_v1')]

def _is_simulating():
return False

monkeypatch.setattr(robot, 'is_simulating', _is_simulating)

for left_model, right_model, preferred in pipette_combinations:
def dummy_read_model(self, mount):
if mount == 'left':
Expand Down

0 comments on commit 114b986

Please sign in to comment.