Include fix for XML output formatting being minified in the last two tests

Removed needless elipses
Replace elipses with <BLANKLINE>
Remove doctest: +SKIP (oops)
master
Jason Morgan 1 year ago
parent 9b71ffc25f
commit de2e7f0791
  1. 1
      pypeg2/xmlast.py
  2. 10
      samples/sample2.py

@ -126,6 +126,7 @@ def thing2xml(thing, pretty=False, object_names=False):
if pretty:
warnings.warn("lxml is needed for pretty printing",
ImportWarning)
etree.indent(tree)
return etree.tostring(tree)

@ -48,7 +48,7 @@ that=new one
once=anything
twice=goes
[Number 3]
...
<BLANKLINE>
pyPEG contains an XML backend, too:
@ -63,14 +63,13 @@ pyPEG contains an XML backend, too:
<Key name="once">anything</Key>
<Key name="twice">goes</Key>
</Section>
<Section name="Number 3"/>
<Section name="Number 3" />
</IniFile>
...
In this sample the tree contains named objects only. Then we can output object
names as tag names. Spaces in names will be translated into underscores.
>>> print(thing2xml(ini_file, pretty=True, object_names=True).decode()) # doctest: +SKIP
>>> print(thing2xml(ini_file, pretty=True, object_names=True).decode())
<IniFile>
<Number_1>
<this>something</this>
@ -80,9 +79,8 @@ names as tag names. Spaces in names will be translated into underscores.
<once>anything</once>
<twice>goes</twice>
</Number_2>
<Number_3/>
<Number_3 />
</IniFile>
...
"""
from __future__ import unicode_literals, print_function

Loading…
Cancel
Save