def get_status(env): name = env.booth.name return { "status": status.get_daemon_status(env.cmd_runner(), name), "ticket": status.get_tickets_status(env.cmd_runner(), name), "peers": status.get_peers_status(env.cmd_runner(), name), }
def test_failure(self): self.mock_run.run.return_value = ("out", "error", 1) assert_raise_library_error( lambda: lib.get_peers_status(self.mock_run), (Severities.ERROR, report_codes.BOOTH_PEERS_STATUS_ERROR, { "reason": "error\nout" })) self.mock_run.run.assert_called_once_with( [settings.booth_binary, "peers"])
def get_status(env: LibraryEnvironment, instance_name=None): """ get booth status info env string instance_name -- booth instance name """ booth_env = env.get_booth_env(instance_name) _ensure_live_env(env, booth_env) instance_name = booth_env.instance_name return { "status": status.get_daemon_status(env.cmd_runner(), instance_name), "ticket": status.get_tickets_status(env.cmd_runner(), instance_name), "peers": status.get_peers_status(env.cmd_runner(), instance_name), }
def test_failure(self): self.mock_run.run.return_value = ("out", "error", 1) assert_raise_library_error( lambda: lib.get_peers_status(self.mock_run), ( Severities.ERROR, report_codes.BOOTH_PEERS_STATUS_ERROR, { "reason": "error\nout" } ) ) self.mock_run.run.assert_called_once_with( [settings.booth_binary, "peers"] )
def test_with_name(self): self.mock_run.run.return_value = ("output", "", 0) self.assertEqual("output", lib.get_peers_status(self.mock_run, "name")) self.mock_run.run.assert_called_once_with( [settings.booth_binary, "peers", "-c", "name"] )
def get_status(env, name=None): return { "status": status.get_daemon_status(env.cmd_runner(), name), "ticket": status.get_tickets_status(env.cmd_runner(), name), "peers": status.get_peers_status(env.cmd_runner(), name), }