Esempio n. 1
0
 def testParseTreeNoCloseLi(self):
     try:
         ListTree.parse("tree<ul><li>a<li>b<ul><li>c</ul></ul>")
     except Exception:
         pass
     else:
         self.fail("Doesn't handle lists with </li> missing.")
Esempio n. 2
0
 def testParseTreeNoCloseLi(self):
     try:
         ListTree.parse("tree<ul><li>a<li>b<ul><li>c</ul></ul>")
     except Exception:
         pass
     else:
         self.fail("Doesn't handle lists with </li> missing.")
Esempio n. 3
0
 def trees(self):
     return GridFixture([
             [ ListTree.parse("a"),
               ListTree.parse("<ul><li>a</li></ul>") ],
             [ ListTree.parse("<ul><li>BB</li></ul>"),
               ListTree.parse("<ul><li>a</li><li>BB</li></ul>")]],
                        {"name": TreeTypeAdapter})
Esempio n. 4
0
 def trees(self):
     return GridFixture(
         [[ListTree.parse("a"),
           ListTree.parse("<ul><li>a</li></ul>")],
          [
              ListTree.parse("<ul><li>BB</li></ul>"),
              ListTree.parse("<ul><li>a</li><li>BB</li></ul>")
          ]], {"name": TreeTypeAdapter})
Esempio n. 5
0
 def tree(self, aString = None):
     if aString is None:
         aTree = ListTree("")
         aTree.addChild(ListTree("a"))
         aTree.addChild(ListTree("BB"))
         return aTree
     else:
         return ListTree.parse(aString)        
Esempio n. 6
0
 def tree(self, aString=None):
     if aString is None:
         aTree = ListTree("")
         aTree.addChild(ListTree("a"))
         aTree.addChild(ListTree("BB"))
         return aTree
     else:
         return ListTree.parse(aString)
Esempio n. 7
0
 def testParseTree1(self):
     text = "tree<ul><li>a</li></ul>"
     parsed = ListTree.parse(text).toString()
     print text
     print parsed
     assert text == parsed
Esempio n. 8
0
 def testParseTop(self):
     assert self.topTree, ListTree.parse("top")
Esempio n. 9
0
 def assertParsed(self, s):
     print s
     result = ListTree.parse(s).toString()
     print result
     assert s == result
Esempio n. 10
0
 def testTreeTextWithTags(self):
     s = "tree<ul><li>a<i>b</i><b>c</b></li></ul>"
     assert "tree<ul><li>abc</li></ul>" == ListTree.parse(s).textToString()
Esempio n. 11
0
 def testParseSpace(self):
     assert "a" == ListTree.parse("<i>a  </i>").text
Esempio n. 12
0
 def testParseTop(self):
     assert self.topTree, ListTree.parse("top")
Esempio n. 13
0
 def assertParsed(self, s):
     print s
     result = ListTree.parse(s).toString()
     print result
     assert s == result
Esempio n. 14
0
 def testTreeTextWithTags(self):
     s = "tree<ul><li>a<i>b</i><b>c</b></li></ul>"
     assert "tree<ul><li>abc</li></ul>" == ListTree.parse(s).textToString()
Esempio n. 15
0
 def testParseSpace(self):
     assert "a" == ListTree.parse("<i>a  </i>").text
Esempio n. 16
0
 def testParseTree1(self):
     text = "tree<ul><li>a</li></ul>"
     parsed = ListTree.parse(text).toString()
     print text
     print parsed
     assert text == parsed
 def __init__(self, i, aTree):
     self.i = i
     self.tree = ListTree.parse(aTree)