async def main(): agent = start_agent() start_game(GAME_FILE_NAME) while True: print_game_response() cmd = input() should_exit = await process_command(cmd.lower(), agent) if should_exit: break stop_agent(agent)
def stop(self, backend): utils.stop_agent()
def main(): agent = start_agent() input("Press ENTER to exit.\n\n") stop_agent(agent)
def test_stop_agent(self): stop_agent() self.assertEqual(self.svc_ctl_call_count, 1) self.assertEqual(self.service_names, ['juju-api-agent']) self.assertEqual(self.actions, [charmhelpers.STOP])