[Zope-Checkins] SVN: Zope/trunk/src/App/tests/test_Extensions.py More tests for App.Extensions.FuncCode

Tres Seaver tseaver at palladion.com
Sat Apr 3 17:03:35 EDT 2010


Log message for revision 110470:
  More tests for App.Extensions.FuncCode

Changed:
  U   Zope/trunk/src/App/tests/test_Extensions.py

-=-
Modified: Zope/trunk/src/App/tests/test_Extensions.py
===================================================================
--- Zope/trunk/src/App/tests/test_Extensions.py	2010-04-03 20:57:54 UTC (rev 110469)
+++ Zope/trunk/src/App/tests/test_Extensions.py	2010-04-03 21:03:35 UTC (rev 110470)
@@ -51,6 +51,37 @@
         self.assertEqual(fc.co_varnames, ('a', 'b'))
         self.assertEqual(fc.co_argcount, 2)
 
+    def test___cmp___None(self):
+        def f(self):
+            pass
+        fc = self._makeOne(f, im=1)
+        self.failUnless(cmp(fc, None) > 0)
+
+    def test___cmp___non_FuncCode(self):
+        def f(self):
+            pass
+        fc = self._makeOne(f, im=1)
+        self.failUnless(cmp(fc, object()) > 0)
+
+    def test___cmp___w_FuncCode_same_args(self):
+        def f(self, a, b):
+            pass
+        def g(self, a, b):
+            pass
+        fc = self._makeOne(f, im=1)
+        fc2 = self._makeOne(g, im=1)
+        self.failUnless(cmp(fc, fc2) == 0)
+
+    def test___cmp___w_FuncCode_different_args(self):
+        def f(self):
+            pass
+        def g(self, a, b):
+            pass
+        fc = self._makeOne(f, im=1)
+        fc2 = self._makeOne(g, im=1)
+        self.failUnless(cmp(fc, fc2) < 0)
+        
+
 def test_suite():
     return unittest.TestSuite((
         unittest.makeSuite(FuncCodeTests),



More information about the Zope-Checkins mailing list