def create_outreach_le_valuemap(self): value_map = ET.Element("valueMap") value_map_template = self.le_outreach_template['valueMap'] for key in value_map_template: value = get_random(key, "String") value_map_part = EntityConstructor.create_value_map_entry_1(key, value) value_map.append(value_map_part) return value_map
def create_child_value_map_entry(key_name): entry = ET.Element("entry") key_xsi_type = {'xsi:type': "xs:string"} entry_key_attrs = EntityConstructor.XML_SCHEMA entry_key_attrs.update(key_xsi_type) entry_key = ET.SubElement(entry, "key", entry_key_attrs) entry_key.text = key_name entry_value_attrs = {"xsi:type": "ns3:value"} entry_value = ET.SubElement(entry, "value", entry_value_attrs) entry_value_attr_name = ET.SubElement(entry_value, "name") entry_value_attr_name.text = key_name entry_value_timestamp = ET.SubElement(entry_value, "timestamp") entry_value_timestamp.text = str(int(time.time())) entry_value_attr_value = ET.SubElement(entry_value, "value") entry_value_attr_value.text = get_random(key_name, "String") return entry