[Zope-Checkins] CVS: Zope/lib/python/Products/ExternalMethod/tests - testExternalMethod.py:1.2.2.1.2.1

Jim Fulton jim@zope.com
Tue, 23 Apr 2002 08:59:42 -0400


Update of /cvs-repository/Zope/lib/python/Products/ExternalMethod/tests
In directory cvs.zope.org:/tmp/cvs-serv4012/tests

Modified Files:
      Tag: ExternalMethodPickle-branch
	testExternalMethod.py 
Log Message:
Added computed attribute for mapply to make up for removal of func_* attributes from normal state in previous fix

=== Zope/lib/python/Products/ExternalMethod/tests/testExternalMethod.py 1.2.2.1 => 1.2.2.1.2.1 ===
         self.assertEqual(em2(9), math.sqrt(9))
         self.failIf(state.has_key('func_defaults'))
+
+    def test_mapply(self):
+        from ZPublisher.mapply import mapply
+        
+        em1 = ExternalMethod('em', 'test method', 'Test', 'testf')
+        self.assertEqual(mapply(em1, (), {'arg1': 4}), math.sqrt(4))
+        state = em1.__getstate__()
+        em2 = ExternalMethod.__basicnew__()
+        em2.__setstate__(state)
+        self.assertEqual(mapply(em1, (), {'arg1': 9}), math.sqrt(9))