Exemple #1
0
def test_list_paasta_list_instances(mock_list_service_instances, capfd):
    """ paasta_list print each service.instance """

    mock_services = ["service_1.main", "service_2.canary"]

    mock_list_service_instances.return_value = mock_services
    args = mock.MagicMock()
    args.print_instances = True
    paasta_list(args)

    output, _ = capfd.readouterr()
    assert output == "service_1.main\nservice_2.canary\n"
Exemple #2
0
def test_list_paasta_list_instances(mock_list_service_instances, mock_stdout):
    """ paasta_list print each service.instance """

    mock_services = ["service_1.main", "service_2.canary"]

    mock_list_service_instances.return_value = mock_services
    args = mock.MagicMock()
    args.print_instances = True
    paasta_list(args)

    output = mock_stdout.getvalue()
    assert output == "service_1.main\nservice_2.canary\n"
Exemple #3
0
def test_list_paasta_list(mock_list_services, capfd):
    """ paasta_list print each service returned by get_services """

    mock_services = ["service_1", "service_2"]

    mock_list_services.return_value = mock_services
    args = mock.MagicMock()
    args.print_instances = False
    paasta_list(args)

    output, _ = capfd.readouterr()
    assert output == "service_1\nservice_2\n"
Exemple #4
0
def test_list_paasta_list(mock_list_services, mock_stdout):
    """ paasta_list print each service returned by get_services """

    mock_services = ["service_1", "service_2"]

    mock_list_services.return_value = mock_services
    args = mock.MagicMock()
    args.print_instances = False
    paasta_list(args)

    output = mock_stdout.getvalue()
    assert output == "service_1\nservice_2\n"
def test_list_paasta_list_instances(mock_list_service_instances, mock_stdout):
    """ paasta_list print each service.instance """

    mock_services = ['service_1.main', 'service_2.canary']

    mock_list_service_instances.return_value = mock_services
    args = mock.MagicMock()
    args.print_instances = True
    paasta_list(args)

    output = mock_stdout.getvalue()
    assert output == 'service_1.main\nservice_2.canary\n'
def test_list_paasta_list(mock_list_services, mock_stdout):
    """ paasta_list print each service returned by get_services """

    mock_services = ['service_1', 'service_2']

    mock_list_services.return_value = mock_services
    args = mock.MagicMock()
    args.print_instances = False
    paasta_list(args)

    output = mock_stdout.getvalue()
    assert output == 'service_1\nservice_2\n'
Exemple #7
0
def test_list_paasta_list_instances(mock_list_service_instances, mock_stdout):
    """ paasta_list print each service.instance """

    mock_services = ['service_1.main', 'service_2.canary']

    mock_list_service_instances.return_value = mock_services
    args = mock.MagicMock()
    args.print_instances = True
    paasta_list(args)

    output = mock_stdout.getvalue().decode('utf-8')
    assert output == 'service_1.main\nservice_2.canary\n'
Exemple #8
0
def test_list_paasta_list(mock_list_services, mock_stdout):
    """ paasta_list print each service returned by get_services """

    mock_services = ['service_1', 'service_2']

    mock_list_services.return_value = mock_services
    args = mock.MagicMock()
    args.print_instances = False
    paasta_list(args)

    output = mock_stdout.getvalue().decode('utf-8')
    assert output == 'service_1\nservice_2\n'