def test_two_level_tree_with_placeholder(self): b = logging.getLogger('a.b') self.assertEqual(tree(), ('', logging.root, [ ('a', any_placeholder, [ ('a.b', b, []), ]), ]))
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_with_placeholder(self): b = logging.getLogger('a.b') self.assertEqual(tree(), ( '', logging.root, [ ('a', any_placeholder, [ ('a.b', b, []), ]), ]))
def test_one_level_tree(self): a = logging.getLogger('a') b = logging.getLogger('b') self.assertEqual(tree(), ( '', logging.root, [ ('a', a, []), ('b', b, []), ]))
def build_description(node=None): """Return a multi-line string describing a `logging_tree.nodes.Node`. If no `node` argument is provided, then the entire tree of currently active `logging` loggers is printed out. """ if node is None: from logging_tree.nodes import tree node = tree() return '\n'.join([ line.rstrip() for line in describe(node) ]) + '\n'
def build_description(node=None): """Return a multi-line string describing a `logging_tree.nodes.Node`. If no `node` argument is provided, then the entire tree of currently active `logging` loggers is printed out. """ if node is None: from logging_tree.nodes import tree node = tree() return '\n'.join([line.rstrip() for line in describe(node)]) + '\n'
def test_default_tree(self): self.assertEqual(tree(), ('', logging.root, []))