Skip to content

Commit 55d0379

Browse files
authored
Merge pull request #125 from OpenTrons/288-s-add-robot-comment
adds robot.comment for printing custom messages during protocol run
2 parents 0e09a39 + 54218fd commit 55d0379

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

opentrons/robot/robot.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,16 @@ def _do():
478478
log.info('Executing: Home now')
479479
return _do()
480480

481+
def comment(self, description):
482+
def _do():
483+
pass
484+
485+
def _setup():
486+
pass
487+
488+
c = Command(do=_do, setup=_setup, description=description)
489+
self.add_command(c)
490+
481491
def add_command(self, command):
482492

483493
if command.description:

tests/opentrons/protocol/test_robot.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ def test_add_container(self):
3232
}
3333
self.assertEquals(res, expected)
3434

35+
def test_comment(self):
36+
self.robot.clear_commands()
37+
self.robot.comment('hello')
38+
self.assertEquals(len(self.robot.commands()), 1)
39+
self.assertEquals(self.robot._commands[0].description, 'hello')
40+
3541
def test_home_after_disconnect(self):
3642
self.robot.disconnect()
3743
self.assertRaises(RuntimeError, self.robot.home)

0 commit comments

Comments
 (0)