/usr/share/pyshared/zope/securitypolicy/tests/test_zopepolicy.py is in python-zope.securitypolicy 3.7.0-0ubuntu4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | ##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Tests the zope policy.
"""
from doctest import DocFileSuite
import unittest
from zope.component import provideAdapter
from zope.component.testing import setUp as componentSetUp
from zope.component.testing import tearDown as componentTearDown
from zope.annotation.interfaces import IAnnotatable
from zope.annotation.attribute import AttributeAnnotations
from zope.security.management import endInteraction
from zope.securitypolicy.interfaces import IGrantInfo
from zope.securitypolicy.interfaces import IPrincipalRoleManager
from zope.securitypolicy.interfaces import IPrincipalPermissionManager
from zope.securitypolicy.interfaces import IRolePermissionManager
from zope.securitypolicy.principalpermission import \
AnnotationPrincipalPermissionManager
from zope.securitypolicy.principalrole import \
AnnotationPrincipalRoleManager
from zope.securitypolicy.rolepermission import \
AnnotationRolePermissionManager
from zope.securitypolicy.grantinfo import \
AnnotationGrantInfo
class TestZCML(unittest.TestCase):
def testMetaZCML(self):
import zope.configuration
import zope.securitypolicy
zope.configuration.xmlconfig.file("meta.zcml", zope.securitypolicy)
def testConfigureZCML(self):
import zope.configuration
import zope.securitypolicy
zope.configuration.xmlconfig.file("configure.zcml", zope.securitypolicy)
def testSecuritypolicyZCML(self):
import zope.configuration
import zope.securitypolicy
zope.configuration.xmlconfig.file(
"securitypolicy.zcml", zope.securitypolicy)
def setUp(test):
componentSetUp()
endInteraction()
provideAdapter(AttributeAnnotations)
provideAdapter(AnnotationPrincipalPermissionManager, (IAnnotatable,),
IPrincipalPermissionManager)
provideAdapter(AnnotationPrincipalRoleManager, (IAnnotatable,),
IPrincipalRoleManager)
provideAdapter(AnnotationRolePermissionManager, (IAnnotatable,),
IRolePermissionManager)
provideAdapter(AnnotationGrantInfo, (IAnnotatable,), IGrantInfo)
def test_suite():
return unittest.TestSuite((
DocFileSuite('zopepolicy.txt',
package='zope.securitypolicy',
setUp=setUp, tearDown=componentTearDown),
unittest.makeSuite(TestZCML),
))
|