Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
 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)
Пример #4
0
 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)
Пример #5
0
    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)
Пример #6
0
 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')
Пример #7
0
 def test_get_simple(self):
     from AccessControl.ZopeGuards import get_dict_get
     get = get_dict_get({'foo': 'bar'}, 'get')
     self.assertEqual(get('foo'), 'bar')
Пример #8
0
 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')
Пример #9
0
 def test_get_simple(self):
     from AccessControl.ZopeGuards import get_dict_get
     get = get_dict_get({'foo': 'bar'}, 'get')
     self.assertEqual(get('foo'), 'bar')
Пример #10
0
 def test_get_default(self):
     get = get_dict_get({'foo': 'bar'}, 'get')
     self.failUnless(get('baz') is None)
     self.assertEqual(get('baz', 'splat'), 'splat')
Пример #11
0
 def test_get_simple(self):
     get = get_dict_get({'foo': 'bar'}, 'get')
     self.assertEqual(get('foo'), 'bar')
Пример #12
0
    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")
Пример #13
0
    def test_get_simple(self):
        from AccessControl.ZopeGuards import get_dict_get

        get = get_dict_get({"foo": "bar"}, "get")
        self.assertEqual(get("foo"), "bar")
Пример #14
0
 def test_get_default(self):
     get = get_dict_get({'foo': 'bar'}, 'get')
     self.failUnless(get('baz') is None)
     self.assertEqual(get('baz', 'splat'), 'splat')
Пример #15
0
 def test_get_simple(self):
     get = get_dict_get({'foo': 'bar'}, 'get')
     self.assertEqual(get('foo'), 'bar')