@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_report_status_for_cluster_obeys_instance_whitelist(
    mock_stdout,
    mock_report_invalid_whitelist_values,
    mock_execute_paasta_serviceinit_on_remote_master,
):
    service = 'fake_service'
    planned_deployments = ['cluster.instance1', 'cluster.instance2']
    actual_deployments = {
        'cluster.instance1': 'sha',
        'cluster.instance2': 'sha',
    }
    instance_whitelist = ['instance1']

    status.report_status_for_cluster(
        service=service,
        cluster='cluster',
        deploy_pipeline=planned_deployments,
        actual_deployments=actual_deployments,
        instance_whitelist=instance_whitelist,
    )
    output = mock_stdout.getvalue()
    assert 'instance1' in output
    assert output not in 'instance2'
dataset/ETHPy150Open Yelp/paasta/tests/cli/test_cmds_status.py/test_report_status_for_cluster_obeys_instance_whitelist/swapped operands of `not in`