[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication/tests - testZopePublication.py:1.1.2.12

Martijn Pieters mj@zope.com
Wed, 13 Feb 2002 00:03:37 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/ZopePublication/tests
In directory cvs.zope.org:/tmp/cvs-serv14206/App/ZopePublication/tests

Modified Files:
      Tag: Zope-3x-branch
	testZopePublication.py 
Log Message:
Optimizations and code style updates:

  - Use isinstance on type checks

  - Test UnicodeType and StringType through StringTypes

  - Remove use of the string module

  - Use startswith and endswith instead of slices.

  - Fix weird tests where isinstance suffices.


=== Zope3/lib/python/Zope/App/ZopePublication/tests/testZopePublication.py 1.1.2.11 => 1.1.2.12 ===
         ob2 = pub.traverseName(self._createRequest('/bruce',pub), ob, 'bruce')
         self.failUnless(ob2 is not ob)
-        self.failUnless(type(ob2) is Wrapper)
+        self.failUnless(isinstance(ob2, Wrapper))
 
     def testAdaptedTraverseNameWrapping(self):
         from Interface import Interface
@@ -223,7 +223,7 @@
         ob['bruce2'] =  'bruce2'
         pub = self.klass(self.db)
         ob2 = pub.traverseName(self._createRequest('/bruce',pub), ob, 'bruce')
-        self.failUnless(type(ob2) is Wrapper)
+        self.failUnless(isinstance(ob2, Wrapper))
         unw = getobject(ob2)
         self.assertEqual(unw, 'bruce')
 
@@ -250,7 +250,7 @@
         pub = self.klass(self.db)
         ob2,x = pub.getDefaultTraversal(self._createRequest('/bruce',pub), ob)
         self.assertEqual(x, 'dummy')
-        self.failUnless(type(ob2) is Wrapper)
+        self.failUnless(isinstance(ob2, Wrapper))
         unw = getobject(ob2)
         self.assertEqual(unw, 'bruce')