/usr/lib/python2.7/dist-packages/logging_tree/tests/test_node.py is in python-logging-tree 1.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | """Tests for the `logging_tree.node` module."""
import logging.handlers
import unittest
from logging_tree.nodes import tree
from logging_tree.tests.case import LoggingTestCase
class AnyPlaceHolder(object):
def __eq__(self, other):
return isinstance(other, logging.PlaceHolder)
any_placeholder = AnyPlaceHolder()
class NodeTests(LoggingTestCase):
def test_default_tree(self):
self.assertEqual(tree(), ('', logging.root, []))
def test_one_level_tree(self):
a = logging.getLogger('a')
b = logging.getLogger('b')
self.assertEqual(tree(), (
'', logging.root, [
('a', a, []),
('b', b, []),
]))
def test_two_level_tree(self):
a = logging.getLogger('a')
b = logging.getLogger('a.b')
self.assertEqual(tree(), (
'', logging.root, [
('a', a, [
('a.b', b, []),
]),
]))
def test_two_level_tree_with_placeholder(self):
b = logging.getLogger('a.b')
self.assertEqual(tree(), (
'', logging.root, [
('a', any_placeholder, [
('a.b', b, []),
]),
]))
if __name__ == '__main__': # for Python <= 2.4
unittest.main()
|