def test_integration(self, open_connection, write_command): sys.argv = "test.py -p /dev/ttyUSB0 1 2".split() open_connection.return_value = object() main() command = commands.encode_jump_to_main() write_command.assert_any_call(open_connection.return_value, command, [1, 2])
def main(): args = parse_commandline_args() connection = utils.open_connection(args) if args.all is True: ids = list(range(1, 128)) else: ids = args.ids utils.write_command(connection, commands.encode_jump_to_main(), ids)
def run_application(fdesc, destinations): """ Asks the given node to run the application. """ command = commands.encode_jump_to_main() utils.write_command(fdesc, command, destinations)