diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2013-01-24 12:52:32 +0000 |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2013-01-24 12:52:32 +0000 |
commit | 095f14efbaaf838b7772bffd36a466abb9668efe (patch) | |
tree | a5141b7709c586ac58952d0d87dc1899a79fe5fb /tests | |
parent | 6844371fef78a28743e72ff7ce92bb786c64073e (diff) | |
download | logutils-095f14efbaaf838b7772bffd36a466abb9668efe.tar.gz |
Changes for 0.3.3.0.3.3
Diffstat (limited to 'tests')
-rw-r--r-- | tests/logutil_tests.py | 4 | ||||
-rw-r--r-- | tests/test_adapter.py | 3 | ||||
-rw-r--r-- | tests/test_colorize.py | 25 | ||||
-rw-r--r-- | tests/test_dictconfig.py | 17 | ||||
-rw-r--r-- | tests/test_formatter.py | 3 | ||||
-rw-r--r-- | tests/test_queue.py | 3 | ||||
-rw-r--r-- | tests/test_redis.py | 3 | ||||
-rw-r--r-- | tests/test_testing.py | 3 |
8 files changed, 46 insertions, 15 deletions
diff --git a/tests/logutil_tests.py b/tests/logutil_tests.py index 330594c..5a9996d 100644 --- a/tests/logutil_tests.py +++ b/tests/logutil_tests.py @@ -1,9 +1,13 @@ +# +# Copyright (C) 2008-2013 Vinay Sajip. See LICENSE.txt for details. +# import sys from test_testing import LoggingTest from test_dictconfig import ConfigDictTest from test_queue import QueueTest from test_formatter import FormatterTest from test_messages import MessageTest +from test_colorize import ColorizeTest try: from test_redis import RedisQueueTest except ImportError: diff --git a/tests/test_adapter.py b/tests/test_adapter.py index bb008a0..0b7e1fa 100644 --- a/tests/test_adapter.py +++ b/tests/test_adapter.py @@ -1,3 +1,6 @@ +# +# Copyright (C) 2008-2013 Vinay Sajip. See LICENSE.txt for details. +# import logging from logutils.adapter import LoggerAdapter from logutils.testing import TestHandler, Matcher diff --git a/tests/test_colorize.py b/tests/test_colorize.py new file mode 100644 index 0000000..5ec0bb4 --- /dev/null +++ b/tests/test_colorize.py @@ -0,0 +1,25 @@ +# +# Copyright (C) 2012-2013 Vinay Sajip. See LICENSE.txt for details. +# +import logging +import logutils.colorize +import os +import sys +import unittest + +if sys.version_info[0] < 3: + u = lambda o: unicode(o, 'unicode_escape') +else: + u = lambda o: o + +class ColorizeTest(unittest.TestCase): + + def test_colorize(self): + logger = logging.getLogger() + handler = logutils.colorize.ColorizingStreamHandler() + logger.addHandler(handler) + try: + logger.warning(u('Some unicode string with some \u015b\u0107\u017a\xf3\u0142 chars')) + finally: + logger.removeHandler(handler) + diff --git a/tests/test_dictconfig.py b/tests/test_dictconfig.py index 42647a2..bf2ce11 100644 --- a/tests/test_dictconfig.py +++ b/tests/test_dictconfig.py @@ -1,19 +1,6 @@ -# Copyright 2009-2010 by Vinay Sajip. All Rights Reserved. # -# Permission to use, copy, modify, and distribute this software and its -# documentation for any purpose and without fee is hereby granted, -# provided that the above copyright notice appear in all copies and that -# both that copyright notice and this permission notice appear in -# supporting documentation, and that the name of Vinay Sajip -# not be used in advertising or publicity pertaining to distribution -# of the software without specific, written prior permission. -# VINAY SAJIP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL -# VINAY SAJIP BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -# ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - +# Copyright 2009-2013 by Vinay Sajip. See LICENSE.txt for details. +# import logging from logutils.adapter import LoggerAdapter from logutils.dictconfig import dictConfig, named_handlers_supported diff --git a/tests/test_formatter.py b/tests/test_formatter.py index 2c05428..0e73ecf 100644 --- a/tests/test_formatter.py +++ b/tests/test_formatter.py @@ -1,3 +1,6 @@ +# +# Copyright (C) 2009-2013 Vinay Sajip. See LICENSE.txt for details. +# import logging import logutils import os diff --git a/tests/test_queue.py b/tests/test_queue.py index 1f86837..5969d0e 100644 --- a/tests/test_queue.py +++ b/tests/test_queue.py @@ -1,3 +1,6 @@ +# +# Copyright (C) 2010-2013 Vinay Sajip. See LICENSE.txt for details. +# import logging from logutils.testing import TestHandler, Matcher from logutils.queue import QueueHandler, QueueListener, queue diff --git a/tests/test_redis.py b/tests/test_redis.py index cc319cb..dfa7a8f 100644 --- a/tests/test_redis.py +++ b/tests/test_redis.py @@ -1,3 +1,6 @@ +# +# Copyright (C) 2011-2013 Vinay Sajip. See LICENSE.txt for details. +# import logging from logutils.testing import TestHandler, Matcher from logutils.redis import RedisQueueHandler, RedisQueueListener diff --git a/tests/test_testing.py b/tests/test_testing.py index 3fb3e9f..f01fc09 100644 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -1,3 +1,6 @@ +# +# Copyright (C) 2010-2013 Vinay Sajip. See LICENSE.txt for details. +# import logging from logutils.testing import TestHandler, Matcher import unittest |