[Zope3-checkins] CVS: Zope3/src/zope/configuration/tests - test_backward.py:1.2 test_xmlconfig.py:1.2

Jim Fulton jim@zope.com
Wed, 30 Jul 2003 10:35:18 -0400


Update of /cvs-repository/Zope3/src/zope/configuration/tests
In directory cvs.zope.org:/tmp/cvs-serv1117/src/zope/configuration/tests

Modified Files:
	test_backward.py test_xmlconfig.py 
Log Message:
Fixed various tests to reflect fixes to parser info.  I was a bit
careless with the old expected output. If I had looked at it more
closely, I would have notices that something was wrong.


=== Zope3/src/zope/configuration/tests/test_backward.py 1.1 => 1.2 ===
--- Zope3/src/zope/configuration/tests/test_backward.py:1.1	Mon Jul 28 18:22:47 2003
+++ Zope3/src/zope/configuration/tests/test_backward.py	Wed Jul 30 10:35:13 2003
@@ -33,21 +33,22 @@
     ...   print action[:2]
     ...   print action[2]
     ...   print clean_text_w_paths(unicode(action[5]))
-    ...   print action[5].text.strip()
+    ...   if action[5].text.strip():
+    ...      print action[5].text.strip()
     (('simple', u'aa', u'xxx', u'cc'), f)
     (u'aa', u'xxx', u'cc')
     File "tests/backward.zcml", line 26.2-26.34
-       <test:simple a="aa" c="cc">first<
+        <test:simple a="aa" c="cc">first</test:simple>
     first
     (('newsimple', u'naa', u'nbb', u'ncc'), f)
     (u'naa', u'nbb', u'ncc')
     File "tests/backward.zcml", line 27.2-27.48
-       <test:newsimple a="naa" c="ncc" b="nbb">second<
+        <test:newsimple a="naa" c="ncc" b="nbb">second</test:newsimple>
     second
     ('Complex.__init__', None)
     ()
-    File "tests/backward.zcml", line 48.2-55.0
-       <test:testc a="ca" c="cc">
+    File "tests/backward.zcml", line 48.2-53.2
+        <test:testc a="ca" c="cc">
            Third
            <test:factory factory=".f">
               Fourth
@@ -57,19 +58,21 @@
     (('Complex.factory', 1, 2), u'.f')
     (u'ca',)
     File "tests/backward.zcml", line 50.5-52.5
-       <test:factory factory=".f">
+           <test:factory factory=".f">
               Fourth
+           </test:factory>
     Fourth
     (('Complex', 1, 2), f)
     (u'xxx', u'cc')
-    File "tests/backward.zcml", line 48.2-55.0
-       <test:testc a="ca" c="cc">
+    File "tests/backward.zcml", line 48.2-53.2
+        <test:testc a="ca" c="cc">
            Third
            <test:factory factory=".f">
               Fourth
            </test:factory>
         </test:testc>
     Third
+
     """
 
 def test_directive_and_integration_w_python_keywords():
@@ -85,13 +88,14 @@
     (('k', u'f'), f)
     (u'f', u'c', u'x')
     File "tests/backwardkw.zcml", line 26.2-26.43
-       <test:k  for="f"  class="c"  x="x" >first<
+        <test:k  for="f"  class="c"  x="x" >first</test:k>
     first
     (('k', u'ff'), f)
     (u'ff', u'cc', u'xx')
     File "tests/backwardkw.zcml", line 27.2-27.44
-       <test:k2 for="ff" class="cc" x="xx">second<
+        <test:k2 for="ff" class="cc" x="xx">second</test:k2>
     second
+    
     """
 
 def test_suite():


=== Zope3/src/zope/configuration/tests/test_xmlconfig.py 1.1 => 1.2 ===
--- Zope3/src/zope/configuration/tests/test_xmlconfig.py:1.1	Mon Jul 28 18:22:47 2003
+++ Zope3/src/zope/configuration/tests/test_xmlconfig.py	Wed Jul 30 10:35:13 2003
@@ -171,7 +171,7 @@
 
     >>> print clean_info_path(str(data.info))
     File "tests/samplepackage/configure.zcml", line 12.2-12.29
-       <test:foo x="blah" y="0" />
+        <test:foo x="blah" y="0" />
 
     >>> data.package
     >>> data.basepath
@@ -193,7 +193,7 @@
 
     >>> print clean_info_path(str(data.info))
     File "tests/samplepackage/configure.zcml", line 12.2-12.29
-       <test:foo x="blah" y="0" />
+        <test:foo x="blah" y="0" />
 
     >>> data.package
     >>> print clean_path(data.basepath)
@@ -218,7 +218,7 @@
 
     >>> print clean_info_path(str(data.info))
     File "tests/samplepackage/configure.zcml", line 12.2-12.29
-       <test:foo x="blah" y="0" />
+        <test:foo x="blah" y="0" />
 
     >>> data.package is package
     1
@@ -250,7 +250,7 @@
 
     >>> print clean_info_path(str(data.info))
     File "tests/samplepackage/foo.zcml.in", line 12.2-12.28
-       <test:foo x="foo" y="2" />
+        <test:foo x="foo" y="2" />
 
     >>> data.package
     
@@ -272,7 +272,7 @@
 
 def clean_text_w_paths(error):
     r = []
-    for line in error.split("\n"):
+    for line in unicode(error).split("\n"):
       line = line.rstrip()
       if not line:
         continue
@@ -352,14 +352,14 @@
     Conflicting configuration actions
       For: (('x', 'blah'), ('y', 0))
         File "tests/samplepackage/configure.zcml", line 12.2-12.29
-           <test:foo x="blah" y="0" />
+            <test:foo x="blah" y="0" />
         File "tests/samplepackage/bar21.zcml", line 3.2-3.24
-           <foo x="blah" y="0" />
+            <foo x="blah" y="0" />
       For: (('x', 'blah'), ('y', 1))
         File "tests/samplepackage/bar1.zcml", line 5.2-5.24
-           <foo x="blah" y="1" />
+            <foo x="blah" y="1" />
         File "tests/samplepackage/bar2.zcml", line 6.2-6.24
-           <foo x="blah" y="1" />
+            <foo x="blah" y="1" />
 
     Note that the conflicts for (('x', 'blah'), ('y', 2)) aren't
     included in the error because they could be resolved.