def test_getchildrenbyname(self): p = MeiElement("note") el1 = MeiElement("accid") el2 = MeiElement("accid") el3 = MeiElement("dot") children = MeiElementList() children.append(el1) children.append(el2) children.append(el3) p.children = children # this should return a new list accid_children = p.getChildrenByName("accid") self.assertEqual(2, len(accid_children))