def test_pop_validates(self): sm = SecurityManager() old = self.setSecurityManager(sm) pop = get_list_pop([GuardTestCase], 'pop') try: pop() finally: self.setSecurityManager(old) self.assert_(sm.calls)
def test_pop_validates(self): from AccessControl.ZopeGuards import get_list_pop sm = SecurityManager() old = self.setSecurityManager(sm) pop = get_list_pop([GuardTestCase], 'pop') try: pop() finally: self.setSecurityManager(old) self.assert_(sm.calls)
def test_pop_validates(self): from AccessControl.ZopeGuards import get_list_pop sm = SecurityManager() old = self.setSecurityManager(sm) pop = get_list_pop([GuardTestCase], 'pop') try: pop() finally: self.setSecurityManager(old) self.assertTrue(sm.calls)
def test_pop_raises(self): from AccessControl.ZopeGuards import get_list_pop pop = get_list_pop([], 'pop') self.assertRaises(IndexError, pop)
def test_pop_simple(self): from AccessControl.ZopeGuards import get_list_pop pop = get_list_pop(['foo', 'bar', 'baz'], 'pop') self.assertEqual(pop(), 'baz') self.assertEqual(pop(0), 'foo')
def test_pop_raises(self): pop = get_list_pop([], 'pop') self.assertRaises(IndexError, pop)
def test_pop_simple(self): pop = get_list_pop(['foo', 'bar', 'baz'], 'pop') self.assertEqual(pop(), 'baz') self.assertEqual(pop(0), 'foo')
def test_pop_simple(self): from AccessControl.ZopeGuards import get_list_pop pop = get_list_pop(["foo", "bar", "baz"], "pop") self.assertEqual(pop(), "baz") self.assertEqual(pop(0), "foo")