def METHOD_NAME():
    rule = {'command': ['/bin/test/', '--arg', '%(somefield)s'],
            'pipe_alert_text': True, 'type': mock_rule(), 'name': 'Test'}
    alert = CommandAlerter(rule)
    match = {'@timestamp': '2014-01-01T00:00:00',
             'somefield': 'foobarbaz'}
    with pytest.raises(EAException) as ea:
        mock_run = mock.MagicMock(side_effect=OSError)
        with mock.patch("elastalert.alerters.command.subprocess.Popen", mock_run), pytest.raises(OSError) as mock_popen:
            mock_subprocess = mock.Mock()
            mock_popen.return_value = mock_subprocess
            mock_subprocess.communicate.return_value = (None, None)
            alert.alert([match])
    assert 'Error while running command /bin/test/ --arg foobarbaz: ' in str(ea)