def test_plugin_execute():
    plugin = Plugin(MagicMock(), {})
    assert plugin.execute('echo foo') == 0
def test_plugin_execute_raises():
    plugin = Plugin(MagicMock(), {})
    with pytest.raises(RuntimeError) as error:
        plugin.execute('echo "foo')
        assert 'Subprocess returned 2' in error.message
def test_plugin_execute():
    plugin = Plugin(MagicMock(), {}, 'shellexec')
    assert plugin.execute('echo foo') == 0
def test_plugin_execute_raises():
    plugin = Plugin(MagicMock(), {}, 'shellexec')
    with pytest.raises(RuntimeError) as error:
        plugin.execute('echo "foo')
        assert 'Subprocess returned 2' in error.message
def test_plugin_execute_raises():
    plugin = Plugin(None, {})
    with pytest.raises(RuntimeError) as error:
        plugin.execute('echo "foo')
        assert 'Subprocess returned 2' in error.message
def test_plugin_execute():
    plugin = Plugin(None, {})
    assert plugin.execute('echo foo') == 0