Fix unit tests again
This commit is contained in:
1 parent
bc8abdfc62
commit
022c59a094
3 files changed
+5
-5
No files matched your search
@@ -84,7 +84,7 @@ class OctoPrintPermission(Permission):
|
||||
if need.method == 'role':
|
||||
needs.append("RoleNeed('{0}')".format(need.value))
|
||||
|
||||
return '{}("{}", "{}", "{}", {})'.format(self.__class__.__name__, self.key, self.get_name(), self.get_description(), ', '.join(needs))
|
||||
return '{}("{}", "{}", {})'.format(self.__class__.__name__, self.get_name(), self.get_description(), ', '.join(needs))
|
||||
|
||||
|
||||
class CombinedOctoPrintPermission(OctoPrintPermission):
|
||||
|
||||
@@ -11,12 +11,12 @@ from octoprint.access.permissions import Permissions, OctoPrintPermission
|
||||
|
||||
class PermissionsTest(unittest.TestCase):
|
||||
# Update on changes to the available core permissions!
|
||||
_COUNT_REGULAR = 17
|
||||
_COUNT_REGULAR = 18
|
||||
_COUNT_COMBINED = 5
|
||||
_COUNT_ALL = _COUNT_REGULAR + _COUNT_COMBINED
|
||||
|
||||
def test_find(self):
|
||||
permission = Permissions.find("Admin")
|
||||
permission = Permissions.find("ADMIN")
|
||||
self.assertIsNotNone(permission)
|
||||
self.assertEqual(permission.get_name(), "Admin")
|
||||
|
||||
|
||||
@@ -223,8 +223,8 @@ class PluginTestCase(unittest.TestCase):
|
||||
plugin = "some plugin"
|
||||
data = "some data"
|
||||
self.plugin_manager.send_plugin_message(plugin, data)
|
||||
client1.on_plugin_message.assert_called_once_with(plugin, data)
|
||||
client2.on_plugin_message.assert_called_once_with(plugin, data)
|
||||
client1.on_plugin_message.assert_called_once_with(plugin, data, permissions=None)
|
||||
client2.on_plugin_message.assert_called_once_with(plugin, data, permissions=None)
|
||||
|
||||
def test_validate_plugin(self):
|
||||
self.assertTrue("deprecated_plugin" in self.plugin_manager.enabled_plugins)
|
||||
|
||||
Reference in new issue
Block a user