def test_notify_status_allowed(start_stop_cli, project_with_patched_init, status): project = project_with_patched_init cli = start_stop_cli patch_init_to_send_statuses(project, [status]) INSTANCE1 = 'instance-1' cli.start(project, [INSTANCE1], daemonized=True, stateboard=True) check_instances_running(cli, project, [INSTANCE1], daemonized=True, stateboard=True)
def test_notify_status_failed(start_stop_cli, project_with_patched_init): project = project_with_patched_init cli = start_stop_cli HORRIBLE_ERR = "SOME HORRIBLE ERROR" patch_init_to_send_statuses(project, ["Failed: %s" % HORRIBLE_ERR]) INSTANCE1 = 'instance-1' logs = cli.start(project, [INSTANCE1], daemonized=True, capture_output=True, exp_rc=1) assert any([HORRIBLE_ERR in msg for msg in logs]) logs = cli.start(project, stateboard_only=True, daemonized=True, capture_output=True, exp_rc=1) assert any([HORRIBLE_ERR in msg for msg in logs])