al insertar elemento se ubica continuo a los primos

FossilOrigin-Name: 3c26c6d8803c30d15f9baa083fc8cfc2ed8993061196f3299162d6a899680735
This commit is contained in:
bit4bit
2021-11-04 01:46:43 +00:00
parent 2b76cf6a10
commit adbd6d0d0e
2 changed files with 23 additions and 2 deletions

View File

@@ -209,3 +209,13 @@ 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'
def test_facho_xml_keep_orden_slibing():
xml = facho.FachoXML('root')
xml.find_or_create_element('./A')
xml.find_or_create_element('./B')
xml.find_or_create_element('./C')
xml.find_or_create_element('./B', append=True)
xml.find_or_create_element('./A', append=True)
assert xml.tostring() == '<root><A/><A/><B/><B/><C/></root>'