[Checkins] SVN: grok/trunk/src/grok/ftests/ move ftests to a place
where it makes more sense
Philipp von Weitershausen
philikon at philikon.de
Thu Aug 7 18:11:16 EDT 2008
Log message for revision 89517:
move ftests to a place where it makes more sense
Changed:
D grok/trunk/src/grok/ftests/security/xmlrpc.py
A grok/trunk/src/grok/ftests/xmlrpc/require.py
-=-
Deleted: grok/trunk/src/grok/ftests/security/xmlrpc.py
===================================================================
--- grok/trunk/src/grok/ftests/security/xmlrpc.py 2008-08-07 22:09:31 UTC (rev 89516)
+++ grok/trunk/src/grok/ftests/security/xmlrpc.py 2008-08-07 22:11:15 UTC (rev 89517)
@@ -1,63 +0,0 @@
-"""
- >>> from zope.app.testing.xmlrpc import ServerProxy
- >>> server = ServerProxy("http://localhost/")
- >>> mgr_server = ServerProxy("http://mgr:mgrpw@localhost/")
-
-We can access a public method just fine, but a protected method will
-raise Unauthorized:
-
- >>> print server.stomp()
- Manfred stomped.
-
- >>> print server.dance()
- Traceback (most recent call last):
- ProtocolError: <ProtocolError for localhost/: 401 401 Unauthorized>
-
-With manager privileges, the protected method is accessible, however:
-
- >>> print mgr_server.dance()
- Manfred doesn't like to dance.
-
-The same applies when a default permission is defined for all XML-RPC
-methods in a class:
-
- >>> print server.hunt()
- Traceback (most recent call last):
- ProtocolError: <ProtocolError for localhost/: 401 401 Unauthorized>
-
- >>> print mgr_server.hunt()
- ME GROK LIKE MAMMOTH!
-
- >>> print server.eat()
- MMM, MANFRED TASTE GOOD!
-
- >>> print server.rest()
- ME GROK TIRED!
-"""
-import grok
-import zope.interface
-
-class MammothRPC(grok.XMLRPC):
- grok.context(zope.interface.Interface)
-
- def stomp(self):
- return 'Manfred stomped.'
-
- @grok.require('zope.ManageContent')
- def dance(self):
- return 'Manfred doesn\'t like to dance.'
-
-class CavemanRPC(grok.XMLRPC):
- grok.context(zope.interface.Interface)
- grok.require('zope.ManageContent')
-
- def hunt(self):
- return 'ME GROK LIKE MAMMOTH!'
-
- @grok.require('zope.View')
- def eat(self):
- return 'MMM, MANFRED TASTE GOOD!'
-
- @grok.require(grok.Public)
- def rest(self):
- return 'ME GROK TIRED!'
Copied: grok/trunk/src/grok/ftests/xmlrpc/require.py (from rev 89511, grok/trunk/src/grok/ftests/security/xmlrpc.py)
===================================================================
--- grok/trunk/src/grok/ftests/xmlrpc/require.py (rev 0)
+++ grok/trunk/src/grok/ftests/xmlrpc/require.py 2008-08-07 22:11:15 UTC (rev 89517)
@@ -0,0 +1,63 @@
+"""
+ >>> from zope.app.testing.xmlrpc import ServerProxy
+ >>> server = ServerProxy("http://localhost/")
+ >>> mgr_server = ServerProxy("http://mgr:mgrpw@localhost/")
+
+We can access a public method just fine, but a protected method will
+raise Unauthorized:
+
+ >>> print server.stomp()
+ Manfred stomped.
+
+ >>> print server.dance()
+ Traceback (most recent call last):
+ ProtocolError: <ProtocolError for localhost/: 401 401 Unauthorized>
+
+With manager privileges, the protected method is accessible, however:
+
+ >>> print mgr_server.dance()
+ Manfred doesn't like to dance.
+
+The same applies when a default permission is defined for all XML-RPC
+methods in a class:
+
+ >>> print server.hunt()
+ Traceback (most recent call last):
+ ProtocolError: <ProtocolError for localhost/: 401 401 Unauthorized>
+
+ >>> print mgr_server.hunt()
+ ME GROK LIKE MAMMOTH!
+
+ >>> print server.eat()
+ MMM, MANFRED TASTE GOOD!
+
+ >>> print server.rest()
+ ME GROK TIRED!
+"""
+import grok
+import zope.interface
+
+class MammothRPC(grok.XMLRPC):
+ grok.context(zope.interface.Interface)
+
+ def stomp(self):
+ return 'Manfred stomped.'
+
+ @grok.require('zope.ManageContent')
+ def dance(self):
+ return 'Manfred doesn\'t like to dance.'
+
+class CavemanRPC(grok.XMLRPC):
+ grok.context(zope.interface.Interface)
+ grok.require('zope.ManageContent')
+
+ def hunt(self):
+ return 'ME GROK LIKE MAMMOTH!'
+
+ @grok.require('zope.View')
+ def eat(self):
+ return 'MMM, MANFRED TASTE GOOD!'
+
+ @grok.require(grok.Public)
+ def rest(self):
+ return 'ME GROK TIRED!'
More information about the Checkins
mailing list