[Lxml-checkins] r49905 - in lxml/trunk: . doc src/lxml/tests

scoder at codespeak.net scoder at codespeak.net
Tue Dec 18 22:28:46 CET 2007


Author: scoder
Date: Tue Dec 18 22:28:45 2007
New Revision: 49905

Modified:
   lxml/trunk/   (props changed)
   lxml/trunk/doc/api.txt
   lxml/trunk/doc/parsing.txt
   lxml/trunk/doc/tutorial.txt
   lxml/trunk/src/lxml/tests/test_etree.py
Log:
 r3102 at delle:  sbehnel | 2007-12-18 10:09:44 +0100
 fixed test cases after newline-after-document serialisation change


Modified: lxml/trunk/doc/api.txt
==============================================================================
--- lxml/trunk/doc/api.txt	(original)
+++ lxml/trunk/doc/api.txt	Tue Dec 18 22:28:45 2007
@@ -112,11 +112,9 @@
   d
   >>> print etree.tostring(tree)
   <d><e/></d>
-  <BLANKLINE>
 
 ElementTree objects are serialised as complete documents, including
-preceding or trailing processing instructions and comments.  Mind also
-the additional line break at the end.
+preceding or trailing processing instructions and comments.
 
 All operations that you run on such an ElementTree (like XPath, XSLT, etc.)
 will understand the explicitly chosen root as root node of a document.  They

Modified: lxml/trunk/doc/parsing.txt
==============================================================================
--- lxml/trunk/doc/parsing.txt	(original)
+++ lxml/trunk/doc/parsing.txt	Tue Dec 18 22:28:45 2007
@@ -514,7 +514,7 @@
 
   >>> tree = etree.ElementTree(el)
   >>> etree.tounicode(tree)
-  u'<test><subtest/></test>\n'
+  u'<test><subtest/></test>'
 
 The result of ``tounicode()`` can be treated like any other Python unicode
 string and then passed back into the parsers.  However, if you want to save

Modified: lxml/trunk/doc/tutorial.txt
==============================================================================
--- lxml/trunk/doc/tutorial.txt	(original)
+++ lxml/trunk/doc/tutorial.txt	Tue Dec 18 22:28:45 2007
@@ -401,8 +401,7 @@
 and general document handling.  One of the bigger differences is that
 it serialises as a complete document, as opposed to a single
 ``Element``.  This includes top-level processing instructions and
-comments, an additional line break at the end, as well as a DOCTYPE
-and other DTD content in the document::
+comments, as well as a DOCTYPE and other DTD content in the document::
 
     >>> from StringIO import StringIO
     >>> tree = etree.parse(StringIO('''\
@@ -424,7 +423,6 @@
     <root>
       <a>eggs</a>
     </root>
-    <BLANKLINE>
 
     >>> # lxml 1.3.4 and later
     >>> print etree.tostring(etree.ElementTree(tree.getroot()))
@@ -434,7 +432,6 @@
     <root>
       <a>eggs</a>
     </root>
-    <BLANKLINE>
 
     >>> # ElementTree and lxml <= 1.3.3
     >>> print etree.tostring(tree.getroot())
@@ -495,7 +492,6 @@
 
     >>> print etree.tostring(tree)
     <root>data</root>
-    <BLANKLINE>
 
 Note that ``parse()`` returns an ElementTree object, not an Element object as
 the string parser functions::
@@ -559,7 +555,6 @@
 
     >>> print etree.tostring(tree)
     <root><a/></root>
-    <BLANKLINE>
 
 The second way is through a feed parser interface, given by the ``feed(data)``
 and ``close()`` methods::

Modified: lxml/trunk/src/lxml/tests/test_etree.py
==============================================================================
--- lxml/trunk/src/lxml/tests/test_etree.py	(original)
+++ lxml/trunk/src/lxml/tests/test_etree.py	Tue Dec 18 22:28:45 2007
@@ -284,7 +284,7 @@
         tostring = self.etree.tostring
         XMLParser = self.etree.XMLParser
 
-        xml = '<?test?>\n<a><?A?><b><?B?><c/></b><?C?></a>\n<?tail?>\n'
+        xml = '<?test?><a><?A?><b><?B?><c/></b><?C?></a><?tail?>'
 
         f = StringIO(xml)
         tree = parse(f)
@@ -295,7 +295,7 @@
         parser = XMLParser(remove_pis=True)
         tree = parse(f, parser)
         self.assertEquals(
-            '<a><b><c/></b></a>\n',
+            '<a><b><c/></b></a>',
             tostring(tree))
 
     def test_parse_parser_type_error(self):
@@ -1819,7 +1819,7 @@
           <!ELEMENT test (a)>
           <!ELEMENT a (#PCDATA)>
         ]>
-        <test><a>test-test</a></test>
+        <test><a>test-test</a></test>\
         '''
         tree = self.etree.parse(StringIO(xml))
         self.assertEqual(self.etree.tostring(tree).replace(" ", ""),


More information about the lxml-checkins mailing list