Commit Graph

60 Commits

Author SHA1 Message Date
Florent Xicluna bc27c6a5aa Various tests cleanup: check_warnings/check_py3k_warnings, unittest.assert* and setUp/tearDown. 2010-03-19 18:34:55 +00:00
Ezio Melotti 187f93d986 Use "x in y" instead of y.find(x) != -1. 2010-03-17 14:22:34 +00:00
Florent Xicluna 1b51c3d4de Do not chdir when running test_xml_etree, and enhance the findfile helper. 2010-03-13 12:41:48 +00:00
Florent Xicluna 13ba1a1c65 Move the xml test data to their own directory. 2010-03-13 11:18:49 +00:00
Georg Brandl cd4a21bb8e Fix more unbound locals in code paths that do not seem to be used. 2010-02-06 23:34:10 +00:00
Benjamin Peterson 5c8da86f3a convert usage of fail* to assert* 2009-06-30 22:57:08 +00:00
R. David Murray 0374a82f75 Issue #2170: refactored xml.dom.minidom.normalize, increasing both
its clarity and its speed.
2009-04-09 21:54:50 +00:00
Benjamin Peterson bec087f29d fix incorrect auto-translation of TestSkipped -> unittest.SkipTest 2009-03-26 21:10:30 +00:00
Benjamin Peterson 888a39b54c remove test_support.TestSkipped and just use unittest.SkipTest 2009-03-26 20:48:25 +00:00
Martin v. Löwis 27e4a179f2 Issue #1390: Raise ValueError in toxml when an invalid comment would
otherwise be produced.
2008-05-23 15:18:28 +00:00
Christian Heimes c5f05e45cf Patch #2167 from calvin: Remove unused imports 2008-02-23 17:40:11 +00:00
Andrew M. Kuchling 19aff0c90a #1433694: minidom's .normalize() failed to set .nextSibling for last element.
Fix by Malte Helmert
2008-02-23 17:10:46 +00:00
Neal Norwitz 0d4c06e06e Whitespace normalization. Ugh, we really need to do this more often.
You might want to review this change as it's my first time.  Be gentle. :-)
2007-04-25 06:30:05 +00:00
Collin Winter d28fcbc7fb Consolidate patches #1690164, 1683397, and 1690169, all of which refactor XML-related test suites. The patches are applied together because they use a common output/xmltests file.
Thanks to Jerry Seutter for all three patches.
2007-03-28 23:34:06 +00:00
Fred Drake fbdeaad069 expunge the xmlcore changes:
41667, 41668 - initial switch to xmlcore
  47044        - mention of xmlcore in What's New
  50687        - mention of xmlcore in the library reference

re-apply xmlcore changes to xml:
  41674        - line ending changes (re-applied manually), directory props
  41677        - add cElementTree wrapper
  41678        - PSF licensing for etree
  41812        - whitespace normalization
  42724        - fix svn:eol-style settings
  43681, 43682 - remove Python version-compatibility cruft from minidom
  46773        - fix encoding of \r\n\t in attr values in saxutils
  47269        - added XMLParser alias for cElementTree compatibility

additional tests were added in Lib/test/test_sax.py that failed with
the xmlcore changes; these relate to SF bugs #1511497, #1513611
2006-07-29 16:56:15 +00:00
Tim Peters 536cf99536 Whitespace normalization. 2005-12-25 23:18:31 +00:00
Fred Drake c6730e1772 move the xml package implementation to xmlcore, and adjust the tests to
test that package, not the xmlcore/PyXML switcheroo fiasco in the xml
module/package
2005-12-14 06:20:35 +00:00
Andrew M. Kuchling 841d25ee66 [Patch #1094164] replaceChild(x,x) ends up removing x of the tree. Add fix from Felix Rabe and a test case 2005-11-22 19:03:16 +00:00
Neal Norwitz 484d9a409a Patch #1309009, Fix segfault in pyexpat when the XML document is
in latin_1, but Python incorrectly assumes it is in UTF-8 format

Will backport.
2005-09-30 04:46:49 +00:00
Georg Brandl 905a01aba4 bug [ 1262320 ] minidom.py alternate newl support is broken 2005-08-25 22:14:15 +00:00
Georg Brandl 7eb4b7d177 Fix all wrong instances of "it's". 2005-07-22 21:49:32 +00:00
Walter Dörwald 70a6b49821 Replace backticks with repr() or "%r"
From SF patch #852334.
2004-02-12 17:35:32 +00:00
Martin v. Löwis fd6aaa17d1 Synchronize with PyXML's 1.33: Import missing modules. 2003-01-25 22:02:52 +00:00
Martin v. Löwis aa5af8dce2 Merge PyXML 1.11-1.26:
Re-arrange the imports into "Python normal form."
Add test of the getUserData() / setUserData() methods, including the
NODE_CLONED callback.

Added support for renameNode() and getInterface().
Changed Node.unlink() so an unlinked node is not rendered completely
unusable by setting childNodes to None.
Element.removeAttributeNode() is slightly less destructive.

Added test for the wholeText attribute.

Added a test for Text.replaceWholeText().

Fixed to properly create Element in test of user data

Rename a local variable so it makes sense when viewed as a sequence.
Unlink a few documents when we're done with them.

Added tests to define the behavior of the cloneNode() and importNode()
mehods, especially in the "difficult" cases of document and
document-type nodes.

Filled in a few more of the other cloneNode() tests.

NodeList.item() does not exist before Python 2.2, since it requires being
able to create subtypes of list.  Use the subscript syntax instead.

Added a test that minidom documents can be pickled and unpickled.
Closes SF bug #609641.

Fill in an empty test, making sure we get the whitespace right for the
data attribute of a processing instruction.

Added checks for a few more invariants for processing instructions.

testProcessingInstruction():  The length attribute of the NodeList
    interface is not implemented for Python 2.0, 2.1, so only use
    len() to test the length.

testSchemaType():  New test, testing just the minimum of schemaType
    support; this is different from the test_xmlbuilder version of the
    test since it doesn't rely on using a specific builder, and the
    builders support different levels of DTD support.

Add tests for the removeNamedItem() and removeNamedItemNS() methods of
the NamedNodeMap instances found on Element nodes.
These do not pass; the fix will be committed shortly.

Added support for the DOM Level 3 (draft) Element.setIdAttribute*() methods.

Do more to avoid creating new Attr nodes, so that attributes do not lose
their ID-ness when set using setIdAttribute*().
2003-01-25 21:39:09 +00:00
Fred Drake 6dd7d07aa6 If PyXML is installed, there is no Node.allnodes, so that portion of
the test should be skipped if that's the case.
2002-09-12 17:03:02 +00:00
Fred Drake fd83374fe2 Remove duplicate checks of the Node.allnodes variable. 2002-07-25 20:40:28 +00:00
Barry Warsaw 04f357cffe Get rid of relative imports in all unittests. Now anything that
imports e.g. test_support must do so using an absolute package name
such as "import test.test_support" or "from test import test_support".

This also updates the README in Lib/test, and gets rid of the
duplicate data dirctory in Lib/test/data (replaced by
Lib/email/test/data).

Now Tim and Jack can have at it. :)
2002-07-23 19:04:11 +00:00
Fred Drake c441f7b3a6 Follow PyXML: Remove all prints from successful tests. This means we can
also drop the output file.
2002-07-19 22:16:41 +00:00
Martin v. Löwis 7d650ca83b Implement the encoding argument for toxml and toprettyxml.
Document toprettyxml.
2002-06-30 15:05:00 +00:00
Fred Drake 2998a55f2d Attribute nodes did not always get their ownerDocument and ownerElement
properly set.  This fixes that.
2001-12-06 18:27:48 +00:00
Fred Drake e50959a58e Fix appendChild() and insertBefore() (and replaceChild() indirectly) when
the node being added is a fragment node.
This closes SF bug #487929.
2001-12-06 04:32:18 +00:00
Guido van Rossum e2ae77b8b8 SF patch #474590 -- RISC OS support 2001-10-24 20:42:55 +00:00
Fred Drake 946f7b1b24 Update the xml.dom.minidom tests to cover the DOM-compliant parts of the
NodeList interface.
2001-09-28 20:31:50 +00:00
Martin v. Löwis 351c3d0554 Implement testGetElementsByTagNameNS. 2001-06-03 14:27:02 +00:00
Tim Peters 0009c4ea59 Whitespace normalization. 2001-02-21 07:29:48 +00:00
Andrew M. Kuchling bc8f72cccc Patch #103854: raises an exception if a non-Attr node is passed to
NamedNodeMap.setNamedItem().  Martin, should I sync the PyXML tree, too,
 or do you want to do it?  (I don't know if you're wrapping the 0.6.4
 release right now.)
2001-02-21 01:30:26 +00:00
Martin v. Löwis fe28ca09a5 Add xml declaration into toxml testcase. 2001-02-06 01:16:48 +00:00
Fred Drake acfb3f6006 Revise the driver code to be more informative in the final report. 2001-02-01 18:11:29 +00:00
Martin v. Löwis 2bcb32372c Except HierarchyRequestErr instead of TypeError. 2001-01-27 09:17:55 +00:00
Fredrik Lundh f785042433 a bold attempt to fix things broken by MAL's verify patch: import
'verify' iff it's used by a test module...
2001-01-17 21:51:36 +00:00
Marc-André Lemburg 3661908a6a This patch removes all uses of "assert" in the regression test suite
and replaces them with a new API verify(). As a result the regression
suite will also perform its tests in optimization mode.

Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
2001-01-17 19:11:13 +00:00
Andrew M. Kuchling 6d0cee1170 Add forgotten import 2001-01-02 20:56:42 +00:00
Andrew M. Kuchling ad4a558af8 Added test case for legal DOM children 2000-12-31 04:03:27 +00:00
Fred Drake 1703cf662c Before calling traceback.print_exc(), call sys.stdout.flush(). This makes
it much easier to see where things went wrong.
2000-12-15 21:31:59 +00:00
Fred Drake 3277da0f33 Update the test suite to cover more ground.
This closes patch #102477.
2000-12-14 18:20:22 +00:00
Fred Drake a1bde802f1 testInsertBefore(): Rewritten to actually test insertBefore() somewhat.
testAAA(),
testAAB():  Added checks that the results are right.

testTooManyDocumentElements():  Added code to actually test this.

testCloneElementDeep()
testCloneElementShallow():  Filled these in with test code.

_testCloneElementCopiesAttributes(),
_setupCloneElement():  Helper functions used with the other
        testCloneElement*() functions.

testCloneElementShallowCopiesAttributes():  No longer a separate test;
        _setupCloneElement() uses _testCloneElementCopiesAttributes() to
        test that this is always done.

testNormalize():  Added to check Node.normalize().
2000-11-21 22:02:43 +00:00
Fred Drake 004d5e6880 Make reindent.py happy (convert everything to 4-space indents!). 2000-10-23 17:22:08 +00:00
Lars Gustäbel 5bad5a4be2 Updated test suite to latest pulldom changes. 2000-10-13 20:54:10 +00:00
Jeremy Hylton 3b0c600394 cosmetic changes only:
use standard Python style for whitespace near = and ()
2000-10-12 17:31:36 +00:00
Lars Gustäbel f27f5ab31f Added additional test cases for pulldom modifications. 2000-10-11 22:36:00 +00:00