def test_map_succeeds(self): sm = SecurityManager() # accepts old = self.setSecurityManager(sm) self.assertEqual(guarded_map(str, [1,2,3]), ['1','2','3']) self.assertEqual(guarded_map(lambda x,y: x+y, [1,2,3], [3,2,1]), [4,4,4]) self.setSecurityManager(old)
def test_map_succeeds(self): from AccessControl.ZopeGuards import guarded_map sm = SecurityManager() # accepts old = self.setSecurityManager(sm) self.assertEqual(guarded_map(str, [1, 2, 3]), ['1', '2', '3']) self.assertEqual(guarded_map(lambda x, y: x + y, [1, 2, 3], [3, 2, 1]), [4, 4, 4]) self.setSecurityManager(old)
def test_map_succeeds(self): from AccessControl.ZopeGuards import guarded_map sm = SecurityManager() # accepts old = self.setSecurityManager(sm) self.assertEqual(guarded_map(str, [1, 2, 3]), ["1", "2", "3"]) self.assertEqual(guarded_map(lambda x, y: x + y, [1, 2, 3], [3, 2, 1]), [4, 4, 4]) self.setSecurityManager(old)