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

Fred L. Drake fdrake@users.sourceforge.net
2001年5月22日 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)

AltStyle によって変換されたページ (->オリジナル) /