~ubuntu-branches/ubuntu/wily/zope.app.security/wily

« back to all changes in this revision

Viewing changes to src/zope/app/security/tests/test_principalregistry.py

  • Committer: Bazaar Package Importer
  • Author(s): Gediminas Paulauskas
  • Date: 2010-12-02 19:34:05 UTC
  • Revision ID: james.westby@ubuntu.com-20101202193405-ssc1x1c1pznqdrnc
Tags: upstream-3.7.5
ImportĀ upstreamĀ versionĀ 3.7.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
##############################################################################
 
2
#
 
3
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
 
4
# All Rights Reserved.
 
5
#
 
6
# This software is subject to the provisions of the Zope Public License,
 
7
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
 
8
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 
9
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 
10
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 
11
# FOR A PARTICULAR PURPOSE.
 
12
#
 
13
##############################################################################
 
14
"""Global Authentication Serive or Principal Registry Tests
 
15
 
 
16
$Id: test_principalregistry.py 106799 2009-12-20 04:50:49Z fafhrd $
 
17
"""
 
18
import unittest
 
19
from zope.testing import doctest
 
20
 
 
21
def test_bbb_imports():
 
22
    """
 
23
    Let's check that principal registry that was moved to
 
24
    zope.principalregistry is still importable from original places.
 
25
 
 
26
      >>> import zope.app.security.principalregistry as old
 
27
      >>> import zope.principalregistry.principalregistry as new
 
28
 
 
29
      >>> old.DuplicateLogin is new.DuplicateLogin
 
30
      True
 
31
      >>> old.DuplicateId is new.DuplicateId
 
32
      True
 
33
      >>> old.PrincipalRegistry is new.PrincipalRegistry
 
34
      True
 
35
      >>> old.principalRegistry is new.principalRegistry
 
36
      True
 
37
      >>> old.PrincipalBase is new.PrincipalBase
 
38
      True
 
39
      >>> old.Group is new.Group
 
40
      True
 
41
      >>> old.Principal is new.Principal
 
42
      True
 
43
      >>> old.UnauthenticatedPrincipal is new.UnauthenticatedPrincipal
 
44
      True
 
45
      >>> old.fallback_unauthenticated_principal is new.fallback_unauthenticated_principal
 
46
      True
 
47
      >>> old.UnauthenticatedGroup is new.UnauthenticatedGroup
 
48
      True
 
49
      >>> old.AuthenticatedGroup is new.AuthenticatedGroup
 
50
      True
 
51
      >>> old.EverybodyGroup is new.EverybodyGroup
 
52
      True
 
53
 
 
54
      >>> import zope.app.security.metadirectives as old
 
55
      >>> import zope.principalregistry.metadirectives as new
 
56
 
 
57
      >>> old.IBasePrincipalDirective is new.IBasePrincipalDirective
 
58
      True
 
59
      >>> old.IDefinePrincipalDirective is new.IDefinePrincipalDirective
 
60
      True
 
61
      >>> old.IDefineUnauthenticatedPrincipalDirective is new.IDefineUnauthenticatedPrincipalDirective
 
62
      True
 
63
      >>> old.IDefineUnauthenticatedGroupDirective is new.IDefineUnauthenticatedGroupDirective
 
64
      True
 
65
      >>> old.IDefineAuthenticatedGroupDirective is new.IDefineAuthenticatedGroupDirective
 
66
      True
 
67
      >>> old.IDefineEverybodyGroupDirective is new.IDefineEverybodyGroupDirective
 
68
      True
 
69
 
 
70
      >>> import zope.app.security.metaconfigure as old
 
71
      >>> import zope.principalregistry.metaconfigure as new
 
72
 
 
73
      >>> old.principal is new.principal
 
74
      True
 
75
      >>> old.unauthenticatedPrincipal is new.unauthenticatedPrincipal
 
76
      True
 
77
      >>> old.unauthenticatedGroup is new.unauthenticatedGroup
 
78
      True
 
79
      >>> old.authenticatedGroup is new.authenticatedGroup
 
80
      True
 
81
      >>> old.everybodyGroup is new.everybodyGroup
 
82
      True
 
83
 
 
84
    """
 
85
 
 
86
def test_suite():
 
87
    return unittest.TestSuite((
 
88
        doctest.DocTestSuite(),
 
89
        ))