~sidnei/zope3/ztk-1.1

« back to all changes in this revision

Viewing changes to src/zope/securitypolicy/tests/test_principalpermissionmanager.py

  • Committer: Sidnei da Silva
  • Date: 2011-04-08 22:10:13 UTC
  • Revision ID: sidnei.da.silva@canonical.com-20110408221013-lrjto3qdiupekwdc
- Upgrade to ztk 1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
##############################################################################
2
2
#
3
 
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
 
3
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
4
4
# All Rights Reserved.
5
5
#
6
6
# This software is subject to the provisions of the Zope Public License,
12
12
#
13
13
##############################################################################
14
14
"""Test handler for PrincipalPermissionManager module.
15
 
 
16
 
$Id: test_principalpermissionmanager.py 98094 2009-03-14 15:50:25Z nadako $
17
15
"""
18
16
import unittest
19
17
 
100
98
        self.assertEqual(manager.getPermissionsForPrincipal(principal), [])
101
99
        # check the result of getSetting() when it's empty.
102
100
        self.assertEqual(manager.getSetting(permission, principal), Unset)
 
101
        # check the result of getSetting() when it's empty and a default
 
102
        # passed in
 
103
        self.assertEqual(manager.getSetting(permission, principal, 1), 1)
103
104
        # check the result of getSetting() when it's allowed.
104
105
        manager.grantPermissionToPrincipal(permission, principal)
105
106
        self.assertEqual(manager.getSetting(permission, principal), Allow)