diff options
Diffstat (limited to 'deluge/tests/test_decorators.py')
-rw-r--r-- | deluge/tests/test_decorators.py | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/deluge/tests/test_decorators.py b/deluge/tests/test_decorators.py index 7d4bd98c8..d2ecd1a2b 100644 --- a/deluge/tests/test_decorators.py +++ b/deluge/tests/test_decorators.py @@ -1,18 +1,14 @@ -# -*- 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 twisted.trial import unittest from deluge.decorators import proxy -class DecoratorsTestCase(unittest.TestCase): +class TestDecorators: def test_proxy_with_simple_functions(self): def negate(func, *args, **kwargs): return not func(*args, **kwargs) @@ -26,16 +22,16 @@ class DecoratorsTestCase(unittest.TestCase): def double_nothing(_bool): return _bool - self.assertTrue(something(False)) - self.assertFalse(something(True)) - self.assertTrue(double_nothing(True)) - self.assertFalse(double_nothing(False)) + assert something(False) + assert not something(True) + assert double_nothing(True) + assert not double_nothing(False) def test_proxy_with_class_method(self): def negate(func, *args, **kwargs): return -func(*args, **kwargs) - class Test(object): + class Test: def __init__(self, number): self.number = number @@ -48,5 +44,5 @@ class DecoratorsTestCase(unittest.TestCase): return self.diff(number) t = Test(5) - self.assertEqual(t.diff(1), -4) - self.assertEqual(t.no_diff(1), 4) + assert t.diff(1) == -4 + assert t.no_diff(1) == 4 |