MCPcopy Index your code
hub / github.com/WebODM/WebODM / test_plugin_functions

Method test_plugin_functions

app/tests/test_plugins.py:234–254  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

232
233
234 def test_plugin_functions(self):
235 # Check db/fs syncing
236 if os.path.exists('coreplugins/test_copy'):
237 print("Removing plugins/test_copy")
238 shutil.rmtree('coreplugins/test_copy')
239
240 sync_plugin_db()
241 self.assertTrue(Plugin.objects.filter(pk='test_copy').count() == 0)
242
243 shutil.copytree('coreplugins/test', 'coreplugins/test_copy')
244
245 sync_plugin_db()
246 self.assertTrue(Plugin.objects.filter(pk='test_copy').count() == 1)
247
248 shutil.rmtree('coreplugins/test_copy')
249 sync_plugin_db()
250 self.assertTrue(Plugin.objects.filter(pk='test_copy').count() == 0)
251
252 # Get manifest works and parses JSON
253 p = get_plugin_by_name("test", only_active=False)
254 self.assertEqual(p.get_manifest()['author'], "Piero Toffanin")
255
256
257 def test_plugin_loading(self):

Callers

nothing calls this directly

Calls 4

sync_plugin_dbFunction · 0.90
get_plugin_by_nameFunction · 0.90
existsMethod · 0.80
get_manifestMethod · 0.80

Tested by

no test coverage detected