def test_pop_validates(self): sm = SecurityManager() old = self.setSecurityManager(sm) pop = get_dict_get({'foo':GuardTestCase}, 'pop') try: pop('foo') finally: self.setSecurityManager(old) self.assert_(sm.calls)
def test_pop_validates(self): from AccessControl.ZopeGuards import get_dict_get sm = SecurityManager() old = self.setSecurityManager(sm) pop = get_dict_get({'foo':GuardTestCase}, 'pop') try: pop('foo') finally: self.setSecurityManager(old) self.assert_(sm.calls)
def test_pop_validates(self): from AccessControl.ZopeGuards import get_dict_get sm = SecurityManager() old = self.setSecurityManager(sm) pop = get_dict_get({'foo': GuardTestCase}, 'pop') try: pop('foo') finally: self.setSecurityManager(old) self.assertTrue(sm.calls)
def test_get_validates(self): from AccessControl.ZopeGuards import get_dict_get sm = SecurityManager() old = self.setSecurityManager(sm) get = get_dict_get({"foo": GuardTestCase}, "get") try: get("foo") finally: self.setSecurityManager(old) self.assert_(sm.calls)
def test_get_default(self): from AccessControl.ZopeGuards import get_dict_get get = get_dict_get({'foo': 'bar'}, 'get') self.failUnless(get('baz') is None) self.assertEqual(get('baz', 'splat'), 'splat')
def test_get_simple(self): from AccessControl.ZopeGuards import get_dict_get get = get_dict_get({'foo': 'bar'}, 'get') self.assertEqual(get('foo'), 'bar')
def test_get_default(self): from AccessControl.ZopeGuards import get_dict_get get = get_dict_get({'foo': 'bar'}, 'get') self.assertTrue(get('baz') is None) self.assertEqual(get('baz', 'splat'), 'splat')
def test_get_default(self): get = get_dict_get({'foo': 'bar'}, 'get') self.failUnless(get('baz') is None) self.assertEqual(get('baz', 'splat'), 'splat')
def test_get_simple(self): get = get_dict_get({'foo': 'bar'}, 'get') self.assertEqual(get('foo'), 'bar')
def test_get_default(self): from AccessControl.ZopeGuards import get_dict_get get = get_dict_get({"foo": "bar"}, "get") self.failUnless(get("baz") is None) self.assertEqual(get("baz", "splat"), "splat")
def test_get_simple(self): from AccessControl.ZopeGuards import get_dict_get get = get_dict_get({"foo": "bar"}, "get") self.assertEqual(get("foo"), "bar")