diff options
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') |