Some tests for the new plugin core functionality
This commit is contained in:
1 parent
8abf152d40
commit
c98f1332be
6 files changed
+52
-12
No files matched your search
@@ -0,0 +1,6 @@
|
||||
def callback(*args, **kwargs):
|
||||
pass
|
||||
|
||||
__plugin_hooks__ = {
|
||||
"some.ordered.callback": (callback, 100)
|
||||
}
|
||||
@@ -7,4 +7,7 @@ def hook_startup():
|
||||
|
||||
__plugin_name__ = "Hook Plugin"
|
||||
__plugin_description__ = "Test hook plugin"
|
||||
__plugin_hooks__ = {'octoprint.core.startup': hook_startup}
|
||||
__plugin_hooks__ = {
|
||||
'octoprint.core.startup': hook_startup,
|
||||
'some.ordered.callback': hook_startup
|
||||
}
|
||||
@@ -9,9 +9,13 @@ import octoprint.plugin
|
||||
|
||||
|
||||
class TestMixedPlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.SettingsPlugin):
|
||||
pass
|
||||
def get_sorting_key(self, context=None):
|
||||
if context == "sorting_test":
|
||||
return 100
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
__plugin_name__ = "Mixed Plugin"
|
||||
__plugin_description__ = "Test mixed plugin"
|
||||
__plugin_implementation__ = TestMixedPlugin()
|
||||
__plugin_implementation__ = TestMixedPlugin()
|
||||
@@ -0,0 +1,6 @@
|
||||
def callback(*args, **kwargs):
|
||||
pass
|
||||
|
||||
__plugin_hooks__ = {
|
||||
"some.ordered.callback": (callback, 10)
|
||||
}
|
||||
@@ -4,9 +4,13 @@ import octoprint.plugin
|
||||
|
||||
|
||||
class TestStartupPlugin(octoprint.plugin.StartupPlugin):
|
||||
pass
|
||||
def get_sorting_key(self, context=None):
|
||||
if context == "sorting_test":
|
||||
return 10
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
__plugin_name__ = "Startup Plugin"
|
||||
__plugin_description__ = "Test startup plugin"
|
||||
__plugin_implementation__ = TestStartupPlugin()
|
||||
__plugin_implementation__ = TestStartupPlugin()
|
||||
Reference in new issue
Block a user