diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-19 15:05:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-19 15:05:49 +0000 |
commit | d395bd510fa4f4376dc5237ab2f8d190a920d35d (patch) | |
tree | 3e3b16b44064938be801aede14381562bae14f6a /deluge/tests/test_web_auth.py | |
parent | Adding upstream version 2.0.3. (diff) | |
download | deluge-a442edfa553d906131bfbb00a015adb3f52719d7.tar.xz deluge-a442edfa553d906131bfbb00a015adb3f52719d7.zip |
Adding upstream version 2.1.1.upstream/2.1.1
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 | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/deluge/tests/test_web_auth.py b/deluge/tests/test_web_auth.py index a518573..39d66c1 100644 --- a/deluge/tests/test_web_auth.py +++ b/deluge/tests/test_web_auth.py @@ -1,18 +1,15 @@ -# -*- 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 -from mock import patch -from twisted.trial import unittest +from unittest.mock import patch from deluge.ui.web import auth -class MockConfig(object): +class MockConfig: def __init__(self, config): self.config = config @@ -23,7 +20,7 @@ class MockConfig(object): self.config[key] = value -class WebAuthTestCase(unittest.TestCase): +class TestWebAuth: @patch('deluge.ui.web.auth.JSONComponent.__init__', return_value=None) def test_change_password(self, mock_json): config = MockConfig( @@ -33,4 +30,4 @@ class WebAuthTestCase(unittest.TestCase): } ) webauth = auth.Auth(config) - self.assertTrue(webauth.change_password('deluge', 'deluge_new')) + assert webauth.change_password('deluge', 'deluge_new') |