[Checkins] SVN: grok/branches/jw-simpler-skin-registration/src/grok/ Fix wording of error message and add test that triggers this exception.

Philipp von Weitershausen philikon at philikon.de
Fri Aug 1 09:16:33 EDT 2008


Log message for revision 89146:
  Fix wording of error message and add test that triggers this exception.
  

Changed:
  U   grok/branches/jw-simpler-skin-registration/src/grok/meta.py
  A   grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/notonlayer.py

-=-
Modified: grok/branches/jw-simpler-skin-registration/src/grok/meta.py
===================================================================
--- grok/branches/jw-simpler-skin-registration/src/grok/meta.py	2008-08-01 13:11:16 UTC (rev 89145)
+++ grok/branches/jw-simpler-skin-registration/src/grok/meta.py	2008-08-01 13:16:32 UTC (rev 89146)
@@ -650,9 +650,9 @@
             # For layers it is required to extend IBrowserRequest.
             raise GrokError(
                 "The grok.skin() directive is used on interface %r. "
-                "However, %r does not subclass IBrowserRequest which is "
+                "However, %r does not extend IBrowserRequest which is "
                 "required for interfaces that are used as layers and are to "
-                "be registered as a skin"
+                "be registered as a skin."
                 % (interface.__identifier__, interface.__identifier__),
                 interface
                 )

Added: grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/notonlayer.py
===================================================================
--- grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/notonlayer.py	                        (rev 0)
+++ grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/notonlayer.py	2008-08-01 13:16:32 UTC (rev 89146)
@@ -0,0 +1,18 @@
+"""
+Make sure that only interfaces extending IBrowserRequest can be
+registered as a skin:
+
+  >>> grok.testing.grok(__name__)
+  Traceback (most recent call last):
+    ...
+  GrokError: The grok.skin() directive is used on interface
+  'grok.tests.skin.notonlayer.NotALayer'. However,
+  'grok.tests.skin.notonlayer.NotALayer' does not extend
+  IBrowserRequest which is required for interfaces that are used as
+  layers and are to be registered as a skin.
+"""
+import grok
+from zope.interface import Interface
+
+class NotALayer(Interface):
+    grok.skin('not a layer')


Property changes on: grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/notonlayer.py
___________________________________________________________________
Name: svn:eol-style
   + native



More information about the Checkins mailing list