def test_getString_2 (self) : # children in query tree have siblings a = fromstring("<a><b><c></c><d></d></b></a>") v = get_Target_String(a, ".//") print (str(v)) self.assertTrue(v == ".//a/b/c/../d/../..")
def test_getString_3 (self) : # no child on query tree a = fromstring("<a></a>") v = get_Target_String(a, ".//") print (str(v)) self.assertTrue(v == ".//a")
def test_getString_1 (self) : # Query tree have more than 1 layer1 a = fromstring("<b><d><c></c></d></b>") v = get_Target_String(a, ".//") print (str(v)) self.assertTrue(v == ".//b/d/c/../..")