[Checkins] SVN: grok/trunk/src/grok/ make sure that calling grok.context multiple times on a module fails

Philipp von Weitershausen philikon at philikon.de
Sat Oct 14 14:34:43 EDT 2006


Log message for revision 70625:
  make sure that calling grok.context multiple times on a module fails
  

Changed:
  U   grok/trunk/src/grok/adapter.txt
  A   grok/trunk/src/grok/tests/modulecontextmultiple.py

-=-
Modified: grok/trunk/src/grok/adapter.txt
===================================================================
--- grok/trunk/src/grok/adapter.txt	2006-10-14 18:30:13 UTC (rev 70624)
+++ grok/trunk/src/grok/adapter.txt	2006-10-14 18:34:42 UTC (rev 70625)
@@ -123,3 +123,14 @@
   True
   >>> isinstance(painting, Painting)
   True
+
+Clean up:
+
+  >>> cleanUp()
+
+You can't call grok.context multiple times on module level:
+
+  >>> import grok.tests.modulecontextmultiple
+  Traceback (most recent call last):
+    ...
+  GrokError: grok.context can only be called once per class or module.

Added: grok/trunk/src/grok/tests/modulecontextmultiple.py
===================================================================
--- grok/trunk/src/grok/tests/modulecontextmultiple.py	2006-10-14 18:30:13 UTC (rev 70624)
+++ grok/trunk/src/grok/tests/modulecontextmultiple.py	2006-10-14 18:34:42 UTC (rev 70625)
@@ -0,0 +1,11 @@
+import grok
+from zope import interface
+
+class Cave(grok.Model):
+    pass
+
+class Club(grok.Model):
+    pass
+
+grok.context(Cave)
+grok.context(Club)


Property changes on: grok/trunk/src/grok/tests/modulecontextmultiple.py
___________________________________________________________________
Name: svn:eol-style
   + native



More information about the Checkins mailing list