From 6a346df287a69bf1649839e79171c3543b03f533 Mon Sep 17 00:00:00 2001 From: JensDiemer Date: Tue, 2 Jun 2015 22:45:29 +0200 Subject: add DocTest --- creole/shared/document_tree.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'creole') diff --git a/creole/shared/document_tree.py b/creole/shared/document_tree.py index eb33aca..527e4f9 100644 --- a/creole/shared/document_tree.py +++ b/creole/shared/document_tree.py @@ -64,6 +64,20 @@ class DocNode: # return "" % (self.kind, self.parent, self.content) def debug(self): + """ + >>> node = DocNode(kind="test", content="foo", attrs={"a":1}, level=0) + >>> node.debug() # doctest: +NORMALIZE_WHITESPACE +REPORT_NDIFF + ________________________________________________________________________________ + DocNode - debug: + str(): + attributes: + attrs: {'a': 1} + children: [] + content: 'foo' + kind: 'test' + level: 0 + parent: None + """ print("_" * 80) print("\tDocNode - debug:") print("str(): %s" % self) @@ -71,6 +85,8 @@ class DocNode: for i in dir(self): if i.startswith("_") or i == "debug": continue + if callable(getattr(self, i)): + continue print("%20s: %r" % (i, getattr(self, i, "---"))) -- cgit v1.2.1