Skip to content

Commit

Permalink
adds robot.comment for printing custom messages during protocol run
Browse files Browse the repository at this point in the history
  • Loading branch information
andySigler committed Nov 28, 2016
1 parent 0e09a39 commit 54218fd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions opentrons/robot/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,16 @@ def _do():
log.info('Executing: Home now')
return _do()

def comment(self, description):
def _do():
pass

def _setup():
pass

c = Command(do=_do, setup=_setup, description=description)
self.add_command(c)

def add_command(self, command):

if command.description:
Expand Down
6 changes: 6 additions & 0 deletions tests/opentrons/protocol/test_robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ def test_add_container(self):
}
self.assertEquals(res, expected)

def test_comment(self):
self.robot.clear_commands()
self.robot.comment('hello')
self.assertEquals(len(self.robot.commands()), 1)
self.assertEquals(self.robot._commands[0].description, 'hello')

def test_home_after_disconnect(self):
self.robot.disconnect()
self.assertRaises(RuntimeError, self.robot.home)
Expand Down

0 comments on commit 54218fd

Please sign in to comment.