Пример #1
0
def test_status_pending_pipeline_build_message(
        mock_get_actual_deployments, mock_get_deploy_info,
        mock_figure_out_service_name, mock_load_system_paasta_config,
        mock_list_services, mock_get_instance_configs_for_service, capfd,
        system_paasta_config,
):
    # If deployments.json is missing SERVICE, output the appropriate message
    service = 'fake_service'
    mock_figure_out_service_name.return_value = service
    mock_list_services.return_value = [service]
    pipeline = [{'instancename': 'cluster.instance'}]
    mock_get_deploy_info.return_value = {'pipeline': pipeline}
    mock_load_system_paasta_config.return_value = system_paasta_config
    mock_instance_config = make_fake_instance_conf('cluster', service, 'instancename')
    mock_get_instance_configs_for_service.return_value = [mock_instance_config]

    actual_deployments = {}
    mock_get_actual_deployments.return_value = actual_deployments
    expected_output = missing_deployments_message(service)

    args = MagicMock()
    args.service = service
    args.deploy_group = None
    args.clusters = None
    args.instances = None
    args.owner = None
    args.soa_dir = utils.DEFAULT_SOA_DIR
    args.registration = None

    paasta_status(args)
    output, _ = capfd.readouterr()
    assert expected_output in output
Пример #2
0
def test_status_pending_pipeline_build_message(
    mock_get_actual_deployments,
    mock_get_deploy_info,
    mock_figure_out_service_name,
    mock_load_system_paasta_config,
    capfd,
):
    # If deployments.json is missing SERVICE, output the appropriate message
    service = 'fake_service'
    mock_figure_out_service_name.return_value = service
    pipeline = [{'instancename': 'cluster.instance'}]
    mock_get_deploy_info.return_value = {'pipeline': pipeline}
    fake_system_paasta_config = utils.SystemPaastaConfig({}, '/fake/config')
    mock_load_system_paasta_config.return_value = fake_system_paasta_config

    actual_deployments = {}
    mock_get_actual_deployments.return_value = actual_deployments
    expected_output = missing_deployments_message(service)

    args = MagicMock()
    args.service = service
    args.deploy_group = None

    paasta_status(args)
    output, _ = capfd.readouterr()
    assert expected_output in output
Пример #3
0
def test_status_pending_pipeline_build_message(
    mock_stdout, mock_get_actual_deployments, mock_get_deploy_info, mock_figure_out_service_name
):
    # If deployments.json is missing SERVICE, output the appropriate message
    service = "fake_service"
    mock_figure_out_service_name.return_value = service
    pipeline = [{"instancename": "cluster.instance"}]
    mock_get_deploy_info.return_value = {"pipeline": pipeline}

    actual_deployments = {}
    mock_get_actual_deployments.return_value = actual_deployments
    expected_output = missing_deployments_message(service)

    args = MagicMock()
    args.service = service

    paasta_status(args)
    output = mock_stdout.getvalue()
    assert expected_output in output
Пример #4
0
def test_status_pending_pipeline_build_message(
        mock_stdout, mock_get_actual_deployments, mock_get_deploy_info,
        mock_figure_out_service_name):
    # If deployments.json is missing SERVICE, output the appropriate message
    service = 'fake_service'
    mock_figure_out_service_name.return_value = service
    pipeline = [{'instancename': 'cluster.instance'}]
    mock_get_deploy_info.return_value = {'pipeline': pipeline}

    actual_deployments = {}
    mock_get_actual_deployments.return_value = actual_deployments
    expected_output = missing_deployments_message(service)

    args = MagicMock()
    args.service = service

    paasta_status(args)
    output = mock_stdout.getvalue()
    assert expected_output in output
Пример #5
0
def test_status_pending_pipeline_build_message(
        mock_stdout, mock_get_actual_deployments, mock_get_deploy_info,
        mock_figure_out_service_name, mock_load_system_paasta_config):
    # If deployments.json is missing SERVICE, output the appropriate message
    service = 'fake_service'
    mock_figure_out_service_name.return_value = service
    pipeline = [{'instancename': 'cluster.instance'}]
    mock_get_deploy_info.return_value = {'pipeline': pipeline}
    fake_system_paasta_config = utils.SystemPaastaConfig({}, '/fake/config')
    mock_load_system_paasta_config.return_value = fake_system_paasta_config

    actual_deployments = {}
    mock_get_actual_deployments.return_value = actual_deployments
    expected_output = missing_deployments_message(service)

    args = MagicMock()
    args.service = service

    paasta_status(args)
    output = mock_stdout.getvalue()
    assert expected_output in output