[Zope3-checkins] CVS: Zope3/src/zope/tal/tests - markbench.py:1.1.2.2 run.py:1.1.2.2 test_files.py:1.1.2.2 test_htmltalparser.py:1.1.2.2 test_talinterpreter.py:1.1.2.2 test_xmlparser.py:1.1.2.2

Fred L. Drake, Jr. fred@zope.com
Mon, 23 Dec 2002 15:38:29 -0500


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

Modified Files:
      Tag: NameGeddon-branch
	markbench.py run.py test_files.py test_htmltalparser.py 
	test_talinterpreter.py test_xmlparser.py 
Log Message:
Fix imports to support the grand renaming.

=== Zope3/src/zope/tal/tests/markbench.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/tal/tests/markbench.py:1.1.2.1	Mon Dec 23 14:33:29 2002
+++ Zope3/src/zope/tal/tests/markbench.py	Mon Dec 23 15:38:28 2002
@@ -14,12 +14,8 @@
 ##############################################################################
 '''Run benchmarks of TAL vs. DTML'''
 
-try:
-    import warnings
-except ImportError:
-    pass
-else:
-    warnings.filterwarnings("ignore", category=DeprecationWarning)
+import warnings
+warnings.filterwarnings("ignore", category=DeprecationWarning)
 
 import os
 os.environ['NO_SECURITY'] = 'true'
@@ -29,7 +25,7 @@
 
 from cStringIO import StringIO
 
-#from DocumentTemplate.DT_HTML import HTMLFile
+#from zope.documenttemplate.dt_html import HTMLFile
 
 from zope.tal.htmltalparser import HTMLTALParser
 from zope.tal.talinterpreter import TALInterpreter


=== Zope3/src/zope/tal/tests/run.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/tal/tests/run.py:1.1.2.1	Mon Dec 23 14:33:29 2002
+++ Zope3/src/zope/tal/tests/run.py	Mon Dec 23 15:38:28 2002
@@ -15,8 +15,9 @@
 """Run all tests."""
 
 import sys
-import zope.tal.tests.utils
 import unittest
+
+import zope.tal.tests.utils
 import zope.tal.tests.test_htmltalparser
 import zope.tal.tests.test_talinterpreter
 import zope.tal.tests.test_files


=== Zope3/src/zope/tal/tests/test_files.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/tal/tests/test_files.py:1.1.2.1	Mon Dec 23 14:33:29 2002
+++ Zope3/src/zope/tal/tests/test_files.py	Mon Dec 23 15:38:28 2002
@@ -14,14 +14,15 @@
 ##############################################################################
 """Tests that run driver.py over input files comparing to output files."""
 
+import glob
 import os
 import sys
-import glob
-
-from Zope.TAL.tests import utils
 import unittest
 
-from Zope.TAL import runtest
+import zope.tal.runtest
+
+from zope.tal.tests import utils
+
 
 class FileTestCase(unittest.TestCase):
 
@@ -47,7 +48,7 @@
         try:
             try:
                 os.chdir(self.__dir)
-                runtest.main()
+                zope.tal.runtest.main()
             finally:
                 os.chdir(pwd)
         except SystemExit, what:


=== Zope3/src/zope/tal/tests/test_htmltalparser.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/tal/tests/test_htmltalparser.py:1.1.2.1	Mon Dec 23 14:33:29 2002
+++ Zope3/src/zope/tal/tests/test_htmltalparser.py	Mon Dec 23 15:38:28 2002
@@ -16,13 +16,11 @@
 
 import pprint
 import sys
-
-from Zope.TAL.tests import utils
 import unittest
 
-
-from Zope.TAL import HTMLTALParser
+from zope.tal import htmltalparser
 from zope.tal.taldefs import TAL_VERSION, TALError, METALError
+from zope.tal.tests import utils
 
 
 class TestCaseBase(unittest.TestCase):
@@ -43,7 +41,7 @@
         return p1+p2
 
     def _run_check(self, source, program, macros={}):
-        parser = HTMLTALParser.HTMLTALParser()
+        parser = htmltalparser.HTMLTALParser()
         parser.parseString(self.prologue + source + self.epilogue)
         got_program, got_macros = parser.getCode()
         program = self._merge(self.initial_program, program)
@@ -56,7 +54,7 @@
                      + "\nExpected:\n" + pprint.pformat(macros))
 
     def _get_check(self, source, program=[], macros={}):
-        parser = HTMLTALParser.HTMLTALParser()
+        parser = htmltalparser.HTMLTALParser()
         parser.parseString(source)
         got_program, got_macros = parser.getCode()
         pprint.pprint(got_program)
@@ -64,7 +62,7 @@
 
     def _should_error(self, source, exc=TALError):
         def parse(self=self, source=source):
-            parser = HTMLTALParser.HTMLTALParser()
+            parser = htmltalparser.HTMLTALParser()
             parser.parseString(self.prologue + source + self.epilogue)
         self.assertRaises(exc, parse)
 
@@ -110,7 +108,7 @@
     def check_code_bad_nesting(self):
         def check(self=self):
             self._run_check("<a><b></a></b>", [])
-        self.assertRaises(HTMLTALParser.NestingError, check)
+        self.assertRaises(htmltalparser.NestingError, check)
 
     def check_code_attr_syntax(self):
         output = [


=== Zope3/src/zope/tal/tests/test_talinterpreter.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/tal/tests/test_talinterpreter.py:1.1.2.1	Mon Dec 23 14:33:29 2002
+++ Zope3/src/zope/tal/tests/test_talinterpreter.py	Mon Dec 23 15:38:28 2002
@@ -15,8 +15,6 @@
 """Tests for TALInterpreter."""
 
 import sys
-
-from Zope.TAL.tests import utils
 import unittest
 
 from StringIO import StringIO
@@ -25,6 +23,7 @@
 from zope.tal.htmltalparser import HTMLTALParser
 from zope.tal.talinterpreter import TALInterpreter
 from zope.tal.dummyengine import DummyEngine
+from zope.tal.tests import utils
 
 
 class TestCaseBase(unittest.TestCase):


=== Zope3/src/zope/tal/tests/test_xmlparser.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/tal/tests/test_xmlparser.py:1.1.2.1	Mon Dec 23 14:33:29 2002
+++ Zope3/src/zope/tal/tests/test_xmlparser.py	Mon Dec 23 15:38:28 2002
@@ -15,20 +15,18 @@
 """Tests for XMLParser.py."""
 
 import sys
-from types import ListType
-
-from Zope.TAL.tests import utils
 import unittest
 
-from Zope.TAL import XMLParser
+from zope.tal import xmlparser
+from zope.tal.tests import utils
 
 
-class EventCollector(XMLParser.XMLParser):
+class EventCollector(xmlparser.XMLParser):
 
     def __init__(self):
         self.events = []
         self.append = self.events.append
-        XMLParser.XMLParser.__init__(self)
+        xmlparser.XMLParser.__init__(self)
         self.parser.ordered_attributes = 1
 
     def get_events(self):
@@ -101,7 +99,7 @@
 
     def _run_check(self, source, events, collector=EventCollector):
         parser = collector()
-        if isinstance(source, ListType):
+        if isinstance(source, list):
             parser.parseStream(SegmentedFile(source))
         else:
             parser.parseString(source)
@@ -112,9 +110,9 @@
 
     def _parse_error(self, source):
         def parse(source=source):
-            parser = XMLParser.XMLParser()
+            parser = xmlparser.XMLParser()
             parser.parseString(source)
-        self.assertRaises(XMLParser.XMLParseError, parse)
+        self.assertRaises(xmlparser.XMLParseError, parse)
 
     def check_processing_instruction_plus(self):
         self._run_check("<?processing instruction?><a/>", [