[Checkins]
SVN: grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/
Simpler test module names
Philipp von Weitershausen
philikon at philikon.de
Fri Aug 1 09:11:16 EDT 2008
Log message for revision 89145:
Simpler test module names
Changed:
A grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/conflict.py
A grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/directive.py
A grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/directive_fixture.py
A grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/directive_onaclass_fixture.py
D grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skin_conflict.py
D grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirective.py
D grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirective_fixture.py
D grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirectiveonaclass_fixture.py
-=-
Copied: grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/conflict.py (from rev 89144, grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skin_conflict.py)
===================================================================
--- grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/conflict.py (rev 0)
+++ grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/conflict.py 2008-08-01 13:11:16 UTC (rev 89145)
@@ -0,0 +1,17 @@
+"""
+We cannot register two skins under the same name::
+
+ >>> grok.testing.grok(__name__)
+ Traceback (most recent call last):
+ ...
+ ConfigurationConflictError: Conflicting configuration actions
+ For: ('utility', <InterfaceClass zope.publisher.interfaces.browser.IBrowserSkinType>, 'foo')
+"""
+
+import grok
+
+class Skin1(grok.IBrowserRequest):
+ grok.skin('foo')
+
+class Skin2(grok.IBrowserRequest):
+ grok.skin('foo')
Copied: grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/directive.py (from rev 89143, grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirective.py)
===================================================================
--- grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/directive.py (rev 0)
+++ grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/directive.py 2008-08-01 13:11:16 UTC (rev 89145)
@@ -0,0 +1,39 @@
+"""
+The skin directive is used to trigger the registration of a layer as a
+IBrowserSkin type. Since layers are really interface classes, we need a special
+directive implementation that will take care of storing data on the interface.
+
+Import - and thus "execute" the skindirective fixture to make the directive
+have effect::
+
+ >>> from grok.tests.skin import directive_fixture
+
+ >>> import grok
+ >>> print grok.skin.bind().get(directive_fixture.IIsAnInterface)
+ skin_name
+
+Unfortunately it is not possible to check whether the directive isn't used on a
+"normal" class instead of an interface class. This means, the directive can be
+*declared* on a normal class, however, using it to retrieve data will fail due
+to the way the directive's store is implemented::
+
+ >>> from grok.tests.skin import directive_onaclass_fixture
+
+ >>> print grok.skin.bind().get(
+ ... directive_onaclass_fixture.NotAnInterfaceClass)
+ Traceback (most recent call last):
+ ...
+ AttributeError: type object 'NotAnInterfaceClass' has no attribute
+ 'queryTaggedValue'
+
+In certain cases we need to set a value on a component as if the directive was
+actually used::
+
+ >>> from zope import interface
+ >>> class IFoo(interface.Interface):
+ ... pass
+ >>> grok.skin.set(IFoo, u'value as set')
+ >>> grok.skin.bind().get(IFoo)
+ u'value as set'
+
+"""
Copied: grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/directive_fixture.py (from rev 89143, grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirective_fixture.py)
===================================================================
--- grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/directive_fixture.py (rev 0)
+++ grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/directive_fixture.py 2008-08-01 13:11:16 UTC (rev 89145)
@@ -0,0 +1,5 @@
+import grok
+from zope import interface
+
+class IIsAnInterface(interface.Interface):
+ grok.skin('skin_name')
Copied: grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/directive_onaclass_fixture.py (from rev 89143, grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirectiveonaclass_fixture.py)
===================================================================
--- grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/directive_onaclass_fixture.py (rev 0)
+++ grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/directive_onaclass_fixture.py 2008-08-01 13:11:16 UTC (rev 89145)
@@ -0,0 +1,4 @@
+import grok
+
+class NotAnInterfaceClass(object):
+ grok.skin('failing_directive')
Deleted: grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skin_conflict.py
===================================================================
--- grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skin_conflict.py 2008-08-01 13:08:35 UTC (rev 89144)
+++ grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skin_conflict.py 2008-08-01 13:11:16 UTC (rev 89145)
@@ -1,17 +0,0 @@
-"""
-We cannot register two skins under the same name::
-
- >>> grok.testing.grok(__name__)
- Traceback (most recent call last):
- ...
- ConfigurationConflictError: Conflicting configuration actions
- For: ('utility', <InterfaceClass zope.publisher.interfaces.browser.IBrowserSkinType>, 'foo')
-"""
-
-import grok
-
-class Skin1(grok.IBrowserRequest):
- grok.skin('foo')
-
-class Skin2(grok.IBrowserRequest):
- grok.skin('foo')
Deleted: grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirective.py
===================================================================
--- grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirective.py 2008-08-01 13:08:35 UTC (rev 89144)
+++ grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirective.py 2008-08-01 13:11:16 UTC (rev 89145)
@@ -1,39 +0,0 @@
-"""
-The skin directive is used to trigger the registration of a layer as a
-IBrowserSkin type. Since layers are really interface classes, we need a special
-directive implementation that will take care of storing data on the interface.
-
-Import - and thus "execute" the skindirective fixture to make the directive
-have effect::
-
- >>> from grok.tests.skin import skindirective_fixture
-
- >>> import grok
- >>> print grok.skin.bind().get(skindirective_fixture.IIsAnInterface)
- skin_name
-
-Unfortunately it is not possible to check whether the directive isn't used on a
-"normal" class instead of an interface class. This means, the directive can be
-*declared* on a normal class, however, using it to retrieve data will fail due
-to the way the directive's store is implemented::
-
- >>> from grok.tests.skin import skindirectiveonaclass_fixture
-
- >>> print grok.skin.bind().get(
- ... skindirectiveonaclass_fixture.NotAnInterfaceClass)
- Traceback (most recent call last):
- ...
- AttributeError: type object 'NotAnInterfaceClass' has no attribute
- 'queryTaggedValue'
-
-In certain cases we need to set a value on a component as if the directive was
-actually used::
-
- >>> from zope import interface
- >>> class IFoo(interface.Interface):
- ... pass
- >>> grok.skin.set(IFoo, u'value as set')
- >>> grok.skin.bind().get(IFoo)
- u'value as set'
-
-"""
Deleted: grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirective_fixture.py
===================================================================
--- grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirective_fixture.py 2008-08-01 13:08:35 UTC (rev 89144)
+++ grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirective_fixture.py 2008-08-01 13:11:16 UTC (rev 89145)
@@ -1,5 +0,0 @@
-import grok
-from zope import interface
-
-class IIsAnInterface(interface.Interface):
- grok.skin('skin_name')
Deleted: grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirectiveonaclass_fixture.py
===================================================================
--- grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirectiveonaclass_fixture.py 2008-08-01 13:08:35 UTC (rev 89144)
+++ grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirectiveonaclass_fixture.py 2008-08-01 13:11:16 UTC (rev 89145)
@@ -1,4 +0,0 @@
-import grok
-
-class NotAnInterfaceClass(object):
- grok.skin('failing_directive')
More information about the Checkins
mailing list