@mark.parametrize('verbosity_level', [0, 2])
@patch('paasta_tools.cli.cmds.status.execute_paasta_serviceinit_on_remote_master', autospec=True)
@patch('paasta_tools.cli.cmds.status.report_invalid_whitelist_values', autospec=True)
@patch('sys.stdout', new_callable=StringIO)
def test_print_cluster_status_calls_execute_paasta_serviceinit_on_remote_master(
    mock_stdout,
    mock_report_invalid_whitelist_values,
    mock_execute_paasta_serviceinit_on_remote_master,
    verbosity_level,
):
    service = 'fake_service'
    planned_deployments = [
        'a_cluster.a_instance',
        'a_cluster.b_instance',
    ]
    actual_deployments = {
        'a_cluster.a_instance': 'this_is_a_sha',
    }
    instance_whitelist = []
    fake_output = "Marathon: 5 instances"
    mock_execute_paasta_serviceinit_on_remote_master.return_value = fake_output
    expected_output = "    %s\n" % fake_output

    status.report_status_for_cluster(
        service=service,
        cluster='a_cluster',
        deploy_pipeline=planned_deployments,
        actual_deployments=actual_deployments,
        instance_whitelist=instance_whitelist,
        verbose=verbosity_level,
    )
    assert mock_execute_paasta_serviceinit_on_remote_master.call_count == 1
    mock_execute_paasta_serviceinit_on_remote_master.assert_any_call(
        'status', 'a_cluster', service, 'a_instance', verbose=verbosity_level)

    output = mock_stdout.getvalue()
    assert output in expected_output
dataset/ETHPy150Open Yelp/paasta/tests/cli/test_cmds_status.py/test_print_cluster_status_calls_execute_paasta_serviceinit_on_remote_master/swapped operands of `in`