Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

import logging 

 

from twisted.internet import defer 

from twisted.trial import unittest 

 

from deluge.log import setup_logger 

 

 

class LogTestCase(unittest.TestCase): 

    def setUp(self):  # NOQA 

        setup_logger(logging.DEBUG) 

 

    def tearDown(self):  # NOQA 

        setup_logger("none") 

 

    def test_old_log_deprecation_warning(self): 

        import warnings 

        from deluge.log import LOG 

        warnings.filterwarnings("ignore", category=DeprecationWarning, 

                                module="deluge.tests.test_log") 

        d = defer.Deferred() 

        d.addCallback(LOG.debug, "foo") 

        self.assertFailure(d, DeprecationWarning) 

        warnings.resetwarnings()