Esempio n. 1
0
def mock_plugin(mocker):
    name = "mock_plugin"
    info = "useful"
    mocker.patch("mock_plugin.init")
    mocker.patch("mock_plugin.cleanup")
    plugins._load_plugin(name, info, os.path.abspath("."))
    plugins.cleanup()
    yield plugins._loaded_plugins[name], info
    del plugins._loaded_plugins[name]
Esempio n. 2
0
def test_do_not_fail_on_plugin_with_syntax_error():
    name = "mock_plugin_syntax_error"
    info = "useful"
    plugins._load_plugin(name, info, os.path.abspath("."))
Esempio n. 3
0
def test_do_not_fail_on_non_existing_plugin():
    plugins._load_plugin("does_not_exist", "any info", os.path.abspath("."))
Esempio n. 4
0
def load_plugin(name, info):
    plugins._load_plugin(name, info, plugins._app_plugin_directory)
Esempio n. 5
0
def mock_plugin():
    name = "mock_plugin"
    plugins._load_plugin(name, os.path.abspath("."))
    plugins.cleanup()
    yield plugins._loaded_plugins[name]
    del plugins._loaded_plugins[name]