Beispiel #1
0
def test_status_chronos_jobs_multiple_jobs():
    jobs = [
        {'name': 'my_service my_instance gityourmom configyourdad'},
        {'name': 'my_service my_instance gityourmom configyourbro'},
    ]
    complete_job_config = mock.Mock()
    complete_job_config.get_desired_state_human = mock.Mock()
    verbose = False
    with contextlib.nested(
        mock.patch(
            'chronos_serviceinit.format_chronos_job_status',
            autospec=True,
            return_value='job_status_output',
        ),
        mock.patch(
            'chronos_serviceinit.get_running_tasks_from_active_frameworks',
            autospec=True,
            return_value=[],
        ),
    ):
        actual = chronos_serviceinit.status_chronos_jobs(
            jobs,
            complete_job_config,
            verbose,
        )
        assert '\njob_status_output\njob_status_output' in actual
Beispiel #2
0
def test_status_chronos_jobs_is_not_deployed():
    jobs = []
    complete_job_config = mock.Mock()
    complete_job_config.get_desired_state_human = mock.Mock()
    verbose = False
    with contextlib.nested(
        mock.patch(
            'chronos_serviceinit.format_chronos_job_status',
            autospec=True,
            return_value='job_status_output',
        ),
        mock.patch(
            'chronos_serviceinit.get_running_tasks_from_active_frameworks',
            autospec=True,
            return_value=[],
        ),
    ):
        actual = chronos_serviceinit.status_chronos_jobs(
            jobs,
            complete_job_config,
            verbose,
        )
        assert 'not set up' in actual