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

Jim Fulton jim@zope.com
Tue, 23 Apr 2002 09:04:21 -0400


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

Modified Files:
	__init__.py 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/__init__.py 1.2 => 1.3 ===


=== Zope/lib/python/Products/ExternalMethod/tests/testExternalMethod.py 1.2 => 1.3 ===
         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))