Files
OctoPrint/tests/access/test_permissions.py
Gina Häußge 7fb9df9940 ♻️ Migrate code base to Python 3 only
* pyupgrade
  * various new codemods
  * manual removal of Py2/3 compat imports
  * manual adjustment of docs, examples, tests
  * to_str is now the new to_unicode, deprecated
    redirection to to_bytes has been removed
  * to_native_str has been redirected to point to
    to_str
  * to_unicode has been redirected to point to
    to_str
  * atomic_write refactored to use
    NamedTemporaryDirectory
  * various other fixes/refactorings all over the
    place
2022-02-01 12:57:01 +01:00

19 lines
459 B
Python

"""
Unit tests for octoprint.access.permissions
"""
import unittest
from octoprint.access.permissions import Permissions
class PermissionsTest(unittest.TestCase):
def test_find(self):
permission = Permissions.find("ADMIN")
self.assertIsNotNone(permission)
self.assertEqual(permission.get_name(), "Admin")
def test_find_fail(self):
permission = Permissions.find("doesntexist")
self.assertIsNone(permission)