示例#1
0
 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)
示例#2
0
 def test_repr(self):
     plugin = PluginEntry('category1', 'name1', 'mock:Mock')
     assert "PluginEntry('category1', 'name1', 'mock:Mock')" == repr(plugin)
示例#3
0
 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)
示例#4
0
 def test_get(self):
     plugin = PluginEntry('category1', 'name1', 'mock:Mock')
     got = plugin.get()
     assert got is Mock