def test_load_error_obj_not_found(self): plugin = PluginEntry('category1', 'name1', 'unittest.mock:i_dont_exist') with pytest.raises(Exception) as exc_info: plugin.load() assert ('Plugin category1:name1 module `unittest.mock`' in str(exc_info.value)) assert 'i_dont_exist' in str(exc_info.value)
def test_repr(self): plugin = PluginEntry('category1', 'name1', 'mock:Mock') assert "PluginEntry('category1', 'name1', 'mock:Mock')" == repr(plugin)
def test_load_error_module_not_found(self): plugin = PluginEntry('category1', 'name1', 'i_dont:exist') with pytest.raises(Exception) as exc_info: plugin.load() assert 'Plugin category1 module `i_dont`' in str(exc_info.value)
def test_get(self): plugin = PluginEntry('category1', 'name1', 'mock:Mock') got = plugin.get() assert got is Mock