summaryrefslogtreecommitdiffstats
path: root/deluge/tests/test_authmanager.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-19 14:52:21 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-19 14:52:21 +0000
commitd1772d410235592b482e3b08b1863f6624d9fe6b (patch)
treeaccfb4b99c32e5e435089f8023d62e67a6951603 /deluge/tests/test_authmanager.py
parentInitial commit. (diff)
downloaddeluge-d1772d410235592b482e3b08b1863f6624d9fe6b.tar.xz
deluge-d1772d410235592b482e3b08b1863f6624d9fe6b.zip
Adding upstream version 2.0.3.upstream/2.0.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'deluge/tests/test_authmanager.py')
-rw-r--r--deluge/tests/test_authmanager.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/deluge/tests/test_authmanager.py b/deluge/tests/test_authmanager.py
new file mode 100644
index 0000000..91e122f
--- /dev/null
+++ b/deluge/tests/test_authmanager.py
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+#
+# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
+# the additional special exception to link portions of this program with the OpenSSL library.
+# See LICENSE for more details.
+#
+
+from __future__ import unicode_literals
+
+import deluge.component as component
+from deluge.common import get_localhost_auth
+from deluge.core.authmanager import AUTH_LEVEL_ADMIN, AuthManager
+
+from .basetest import BaseTestCase
+
+
+class AuthManagerTestCase(BaseTestCase):
+ def set_up(self):
+ self.auth = AuthManager()
+ self.auth.start()
+
+ def tear_down(self):
+ # We must ensure that the components in component registry are removed
+ return component.shutdown()
+
+ def test_authorize(self):
+ self.assertEqual(self.auth.authorize(*get_localhost_auth()), AUTH_LEVEL_ADMIN)