diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 21:38:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 21:38:38 +0000 |
commit | 2e2851dc13d73352530dd4495c7e05603b2e520d (patch) | |
tree | 622b9cd8e5d32091c9aa9e4937b533975a40356c /deluge/tests/test_web_auth.py | |
parent | Initial commit. (diff) | |
download | deluge-2e2851dc13d73352530dd4495c7e05603b2e520d.tar.xz deluge-2e2851dc13d73352530dd4495c7e05603b2e520d.zip |
Adding upstream version 2.1.2~dev0+20240219.upstream/2.1.2_dev0+20240219upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'deluge/tests/test_web_auth.py')
-rw-r--r-- | deluge/tests/test_web_auth.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/deluge/tests/test_web_auth.py b/deluge/tests/test_web_auth.py new file mode 100644 index 0000000..39d66c1 --- /dev/null +++ b/deluge/tests/test_web_auth.py @@ -0,0 +1,33 @@ +# +# 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 unittest.mock import patch + +from deluge.ui.web import auth + + +class MockConfig: + def __init__(self, config): + self.config = config + + def __getitem__(self, key): + return self.config[key] + + def __setitem__(self, key, value): + self.config[key] = value + + +class TestWebAuth: + @patch('deluge.ui.web.auth.JSONComponent.__init__', return_value=None) + def test_change_password(self, mock_json): + config = MockConfig( + { + 'pwd_sha1': '8d8ff487626141d2b91025901d3ab57211180b48', + 'pwd_salt': '7555d757710158655bd1646e207dee21a89e9226', + } + ) + webauth = auth.Auth(config) + assert webauth.change_password('deluge', 'deluge_new') |