Esempio n. 1
0
 def test_xml_matches_2 (self) :
     s = "<Z><A><B><C></C><A></A><D></D></B></A><D><A><B><C></C></B></A></D></Z>"
     c = fromstring(s)
     t = "<A><B><C></C></B></A>"
     p = fromstring(t)
     l = [c.find("A"), c.find("A").find("B").find("A"), c.find("D").find("A")]
     r = xml_matches(l, p)
     self.assertTrue(r == [ l[0], l[1] ])    
Esempio n. 2
0
 def test_xml_matches (self) :
     s = "<A><B><C></C><A></A><D></D></B></A>"
     c = fromstring(s)
     t = "<A><B></B></A>"
     p = fromstring(t)
     l = [c, c.find("B").find("A")]
     r = xml_matches(l, p)
     self.assertTrue(r == [c])