From 7393834a79a4c14a8ee6b84ee96ac457613fa4b3 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 26 Sep 2021 13:29:52 +0200 Subject: [PATCH] plugin load testing --- InvenTree/plugins/test_plugin.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/InvenTree/plugins/test_plugin.py b/InvenTree/plugins/test_plugin.py index db8952c38f..36208dd5a1 100644 --- a/InvenTree/plugins/test_plugin.py +++ b/InvenTree/plugins/test_plugin.py @@ -3,6 +3,8 @@ from django.test import TestCase import plugins.plugin +from plugins.plugins import load_action_plugins, load_barcode_plugins, load_integration_plugins + class InvenTreePluginTests(TestCase): """ Tests for InvenTreePlugin """ @@ -25,3 +27,16 @@ class InvenTreePluginTests(TestCase): self.assertEqual(self.named_plugin.PLUGIN_NAME, 'abc123') self.assertEqual(self.named_plugin.plugin_name(), 'abc123') + +class PluginIntegrationTests(TestCase): + """ Tests for general plugin functions """ + + def test_plugin_loading(self): + """check if plugins load as expected""" + plugin_names_integration = [a().plugin_name() for a in load_integration_plugins()] + #plugin_names_barcode = [a().plugin_name() for a in load_barcode_plugins()] # TODO refactor barcode plugin to support standard loading + #plugin_names_action = [a().plugin_name() for a in load_action_plugins()] # TODO refactor action plugin to support standard loading + + self.assertEqual(plugin_names_integration, ['NoIntegrationPlugin', 'WrongIntegrationPlugin', 'SampleIntegrationPlugin']) + #self.assertEqual(plugin_names_action, '') + #self.assertEqual(plugin_names_barcode, '')