[Zope3-checkins] SVN: Zope3/trunk/src/zope/security/testing.py Added helper classes for writing tests

Jim Fulton jim at zope.com
Thu May 26 11:21:32 EDT 2005


Log message for revision 30510:
  Added helper classes for writing tests
  

Changed:
  A   Zope3/trunk/src/zope/security/testing.py

-=-
Added: Zope3/trunk/src/zope/security/testing.py
===================================================================
--- Zope3/trunk/src/zope/security/testing.py	2005-05-26 12:41:49 UTC (rev 30509)
+++ Zope3/trunk/src/zope/security/testing.py	2005-05-26 15:21:02 UTC (rev 30510)
@@ -0,0 +1,47 @@
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation 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.
+#
+##############################################################################
+"""Testing support code
+
+This module provides some helper/stub objects for setting up interactions.
+
+$Id$
+"""
+
+from zope import interface
+from zope.security import interfaces
+
+class Principal:
+
+    interface.implements(interfaces.IPrincipal)
+
+    def __init__(self, id, title=None, description='', groups=None):
+        self.id = id
+        self.title = title or id
+        self.description = description
+        if groups is not None:
+            self.groups = groups
+            interface.directlyProvides(self, interfaces.IGroupAwarePrincipal)
+
+class Participation:
+
+    interface.implements(interfaces.IParticipation)
+
+    def __init__(self, principal):
+        self.principal = principal
+        self.interaction = None
+
+
+        
+
+    


Property changes on: Zope3/trunk/src/zope/security/testing.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native



More information about the Zope3-Checkins mailing list