Beispiel #1
0
 def test_showtree(self):
     """test Argument.__showtree__()"""
     output = []
     getter, marker = object(), object()
     get = lambda code: output.append((getter, code))
     mark = lambda: output.append(marker)
     node1 = Argument(wraptext("foobar"))
     node2 = Argument(wraptext("foo"), wraptext("bar"))
     node1.__showtree__(output.append, get, mark)
     node2.__showtree__(output.append, get, mark)
     valid = [
         "{{{", (getter, node1.name), "}}}", "{{{", (getter, node2.name),
         "    | ", marker, (getter, node2.default), "}}}"]
     self.assertEqual(valid, output)