From 2e2851dc13d73352530dd4495c7e05603b2e520d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 10 Apr 2024 23:38:38 +0200 Subject: Adding upstream version 2.1.2~dev0+20240219. Signed-off-by: Daniel Baumann --- deluge/tests/test_log.py | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 deluge/tests/test_log.py (limited to 'deluge/tests/test_log.py') diff --git a/deluge/tests/test_log.py b/deluge/tests/test_log.py new file mode 100644 index 0000000..f0dcbee --- /dev/null +++ b/deluge/tests/test_log.py @@ -0,0 +1,47 @@ +# +# Copyright (C) 2015 Calum Lind +# Copyright (C) 2010 Pedro Algarvio +# +# 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. +# + +import logging +import warnings + +from deluge.conftest import BaseTestCase +from deluge.log import setup_logger + + +class TestLog(BaseTestCase): + def set_up(self): + setup_logger(logging.DEBUG) + + def tear_down(self): + setup_logger('none') + + def test_old_log_deprecation_warning(self): + from deluge.log import LOG + + with warnings.catch_warnings(record=True) as w: + # Cause all warnings to always be triggered. + warnings.simplefilter('always') + LOG.debug('foo') + assert w[-1].category == DeprecationWarning + + # def test_twisted_error_log(self): + # from twisted.internet import defer + # import deluge.component as component + # from deluge.core.eventmanager import EventManager + # EventManager() + # + # d = component.start() + # + # @defer.inlineCallbacks + # def call(*args): + # yield component.pause(["EventManager"]) + # yield component.start(["EventManager"]) + # + # d.addCallback(call) + # return d -- cgit v1.2.3