Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(77)  |  Call(77)  |  Derive(0)  |  Import(0)
Fail unless an exception of class excClass is raised
by callableObj when invoked with arguments args and keyword
arguments kwargs. If a different type of exception is
raised, it will not be caught, and the test case will be
deemed to have suffered an error, exactly as for an
unexpected exception.

If called with callableObj omitted or None, will return a
context object used like this::
(more...)

src/p/t/ptahcms-0.5.1/ptahcms/tests/test_container.py   ptahcms(Download)
 
        self.assertRaises(
            ValueError, container.__setitem__, 'content', object())
 
        self.assertRaises(
            ValueError, container.__setitem__, 'content', container)
        self.assertEqual(container.get('content').__uri__, content_uri)
        self.assertEqual(container.get('unknown'), None)
        self.assertRaises(KeyError, container.__getitem__, 'unknown')
 
        content = container['content']
        self.assertRaises(
            KeyError, container.__setitem__, 'content', content)
 
        self.assertRaises(
            TypeError, folder.__setitem__, 'subfolder', container)
 
    def test_container_delete(self):

src/p/t/ptah-0.8.0/ptah/tests/test_security.py   ptah(Download)
    def test_permission_register_same_name(self):
        ptah.Permission('perm', 'Permission1')
        ptah.Permission('perm', 'Permission2')
 
        self.assertRaises(ConfigurationConflictError, self.init_ptah)
    def test_acl_register_same_name(self):
        ptah.ACL('map', 'acl1')
        ptah.ACL('map', 'acl2')
 
        self.assertRaises(ConfigurationConflictError, self.init_ptah)
    def test_role_register_conflict(self):
        ptah.Role('myrole', 'MyRole1')
        ptah.Role('myrole', 'MyRole2')
 
        self.assertRaises(ConfigurationConflictError, self.init_ptah)
 
        self.assertRaises(
            HTTPForbidden, ptah.check_permission, 'View', content, throw=True)
 
        content = Content(acl=[(Allow, ptah.Everyone.id, ALL_PERMISSIONS)])
 
        self.assertRaises(
            HTTPForbidden, ptah.check_permission,

src/p/t/ptah-HEAD/ptah/tests/test_security.py   ptah(Download)
    def test_permission_register_same_name(self):
        ptah.Permission('perm', 'Permission1')
        ptah.Permission('perm', 'Permission2')
 
        self.assertRaises(ConfigurationConflictError, self.init_ptah)
    def test_acl_register_same_name(self):
        ptah.ACL('map', 'acl1')
        ptah.ACL('map', 'acl2')
 
        self.assertRaises(ConfigurationConflictError, self.init_ptah)
    def test_role_register_conflict(self):
        ptah.Role('myrole', 'MyRole1')
        ptah.Role('myrole', 'MyRole2')
 
        self.assertRaises(ConfigurationConflictError, self.init_ptah)
 
        self.assertRaises(
            HTTPForbidden, ptah.check_permission, 'View', content, throw=True)
 
        content = Content(acl=[(Allow, ptah.Everyone.id, ALL_PERMISSIONS)])
 
        self.assertRaises(
            HTTPForbidden, ptah.check_permission,

src/p/t/ptahcms-0.5.1/ptahcms/tests/test_restsrv.py   ptahcms(Download)
        restsrv.RestService('test', 'Test service2')
 
        self.assertRaises(ConfigurationConflictError, self.init_ptah)
 
    def test_rest_registerService_action(self):
        self.assertEqual(ac.callable, raction)
        self.assertEqual(srv(None, 'action'), 'test')
        self.assertRaises(HTTPNotFound, srv, None, 'unknown')
 
    def test_rest_registerService_apidoc(self):

src/p/t/ptah-0.8.0/ptah/manage/tests/test_manage.py   ptah(Download)
        self.assertIn('test-module', MODULES)
 
        self.assertRaises(HTTPForbidden, PtahManageRoute, self.request)
 
        ptah.auth_service.set_userid('test-user')
 
        self.assertRaises(HTTPForbidden, PtahManageRoute, self.request)
        self.assertEqual(mod.url(),'http://example.com/ptah-manage/test-module')
 
        self.assertRaises(KeyError, route.__getitem__, 'unknown')
 
    def test_manage_access_manager1(self):
 
        self.assertIsNotNone(route['test-module1'])
        self.assertRaises(KeyError, route.__getitem__, 'test-module2')
 
    def test_manage_disable_modules(self):
        route = PtahManageRoute(request)
 
        self.assertRaises(KeyError, route.__getitem__, 'test-module')
 
    def test_manage_layout(self):

src/p/t/ptah-HEAD/ptah/manage/tests/test_manage.py   ptah(Download)
        self.assertIn('test-module', MODULES)
 
        self.assertRaises(HTTPForbidden, PtahManageRoute, self.request)
 
        ptah.auth_service.set_userid('test-user')
 
        self.assertRaises(HTTPForbidden, PtahManageRoute, self.request)
        self.assertEqual(mod.url(),'http://example.com/ptah-manage/test-module')
 
        self.assertRaises(KeyError, route.__getitem__, 'unknown')
 
    def test_manage_access_manager1(self):
 
        self.assertIsNotNone(route['test-module1'])
        self.assertRaises(KeyError, route.__getitem__, 'test-module2')
 
    def test_manage_disable_modules(self):
        route = PtahManageRoute(request)
 
        self.assertRaises(KeyError, route.__getitem__, 'test-module')
 
    def test_manage_layout(self):

src/p/t/ptahcms-0.5.1/ptahcms/tests/test_tinfo.py   ptahcms(Download)
        self.assertFalse(MyContent.__type__.is_allowed(content))
        self.assertRaises(
            HTTPForbidden, MyContent.__type__.check_context, content)
 
        #
        self.assertFalse(MyContent.__type__.is_allowed(container))
        self.assertRaises(
            HTTPForbidden, MyContent.__type__.check_context, container)
 
    def test_tinfo_list(self):
            __type__ = ptahcms.Type('mycontent2', 'MyContent')
 
        self.assertRaises(ConfigurationConflictError, self.init_ptah)
 
    def test_tinfo_create(self):

src/p/t/ptahcms-0.5.1/ptahcms/tests/test_security.py   ptahcms(Download)
        wrapper = NodeWrapper(Test())
        self.assertRaises(
            ptahcms.NotFound, wrapper.__getattr__, 'unknown')
 
    def test_cms_wrapper_forbidden(self):
 
        self.assertRaises(
            ptahcms.Forbidden, wrapper.__getattr__, 'update')
 
    def test_cms_wrapper(self):
    def test_cms_not_found(self):
        import ptahcms
 
        self.assertRaises(ptahcms.NotFound, ptahcms.wrap, 'unknown')
        self.assertRaises(ptahcms.NotFound, ptahcms.wrap, None)

src/p/t/ptahcms-0.5.1/ptahcms/manage/tests/test_apps.py   ptahcms(Download)
        self.assertIs(request.app_factory, factory2)
 
        self.assertRaises(KeyError, mod.__getitem__, 'app3')
 
    def test_apps_app_view(self):

src/p/t/ptah-0.8.0/ptah/tests/test_password.py   ptah(Download)
 
        self.assertRaises(
            pform.Invalid, passwordValidator, None, 'pwd')
 
        PasswordTool.validate = vp
            """ """
 
        self.assertRaises(ConfigurationConflictError, self.init_ptah)
 
    def test_password_changer(self):

  1 | 2 | 3 | 4  Next