se adiciona FachoXml.get_element_attribute para obtener atributo de xpath

FossilOrigin-Name: b3be980dca00b8bd117c4a7e176b8d3a9bac804a1200ad4b7cc39e0f4ab0be15
This commit is contained in:
bit4bit
2021-11-03 23:55:20 +00:00
parent fcd5060485
commit f975e666ee
3 changed files with 16 additions and 0 deletions

View File

@@ -204,3 +204,8 @@ def test_facho_xml_set_element_attribute_valid_validation():
xml.set_element_validator('./Id', lambda text, attrs: attrs['code'] == 'ABC')
xml.set_element('./Id', 'mero', code = 'ABC')
def test_facho_xml_get_element_attribute():
xml = facho.FachoXML('root')
xml.set_element('./Id', 'mero', code = 'ABC')
assert xml.get_element_attribute('/root/Id', 'code') == 'ABC'