[Python-checkins] CVS: python/dist/src/Lib/test test_xmllib.py,1.4,1.5

Fred L. Drake fdrake@users.sourceforge.net
Tue, 22 May 2001 13:22:08 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv25992

Modified Files:
	test_xmllib.py 
Log Message:

Simple conversion to PyUnit -- this test really needs more work!


Index: test_xmllib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_xmllib.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** test_xmllib.py	2001/01/17 21:51:36	1.4
--- test_xmllib.py	2001/05/22 20:22:06	1.5
***************
*** 3,12 ****
  '''
  
- from test_support import verbose
- 
  testdoc = """\
  <?xml version="1.0" encoding="UTF-8" standalone='yes' ?>
  <!-- comments aren't allowed before the <?xml?> tag,
       but they are allowed before the <!DOCTYPE> tag -->
  <!DOCTYPE greeting [
    <!ELEMENT greeting (#PCDATA)>
--- 3,11 ----
  '''
  
  testdoc = """\
  <?xml version="1.0" encoding="UTF-8" standalone='yes' ?>
  <!-- comments aren't allowed before the <?xml?> tag,
       but they are allowed before the <!DOCTYPE> tag -->
+ <?processing instructions are allowed in the same places as comments ?>
  <!DOCTYPE greeting [
    <!ELEMENT greeting (#PCDATA)>
***************
*** 15,25 ****
  """
  
  import xmllib
! if verbose:
!     parser = xmllib.TestXMLParser()
! else:
!     parser = xmllib.XMLParser()
! 
! for c in testdoc:
!     parser.feed(c)
! parser.close()
--- 14,30 ----
  """
  
+ import test_support
+ import unittest
  import xmllib
! 
! 
! class XMLParserTestCase(unittest.TestCase):
! 
!     def test_simple(self):
!         parser = xmllib.XMLParser()
!         for c in testdoc:
!             parser.feed(c)
!         parser.close()
! 
! 
! test_support.run_unittest(XMLParserTestCase)