def test_returns_id_list_from_element(self): element = etree.Element("resource_set") for _id in ("A", "B"): etree.SubElement(element, "resource_ref").attrib["id"] = _id self.assertEqual(["A", "B"], resource_set.get_resource_id_set_list(element))
def test_returns_id_list_from_element(self): element = etree.Element("resource_set") for id in ("A", "B"): etree.SubElement(element, "resource_ref").attrib["id"] = id self.assertEqual( ["A", "B"], resource_set.get_resource_id_set_list(element) )
def have_duplicate_resource_sets(element, other_element): get_id_set_list = lambda element: [ resource_set.get_resource_id_set_list(resource_set_item) for resource_set_item in element.findall(".//resource_set") ] return get_id_set_list(element) == get_id_set_list(other_element)
def have_duplicate_resource_sets(element, other_element): get_id_set_list = lambda element: [ resource_set.get_resource_id_set_list(resource_set_item) for resource_set_item in element.findall(".//resource_set") ] return get_id_set_list(element) == get_id_set_list(other_element)