コード例 #1
0
ファイル: testZopeGuards.py プロジェクト: wpjunior/proled
 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)
コード例 #2
0
 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)
コード例 #3
0
    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)