[Checkins] SVN: grok/branches/jw-simpler-skin-registration/src/grok/tests/ Group all skin-related tests in a new subpackage called 'skin'.

Philipp von Weitershausen philikon at philikon.de
Fri Aug 1 09:04:14 EDT 2008


Log message for revision 89143:
  Group all skin-related tests in a new subpackage called 'skin'.
  

Changed:
  D   grok/branches/jw-simpler-skin-registration/src/grok/tests/conflict/skin.py
  D   grok/branches/jw-simpler-skin-registration/src/grok/tests/directive/skindirective.py
  D   grok/branches/jw-simpler-skin-registration/src/grok/tests/directive/skindirective_fixture.py
  D   grok/branches/jw-simpler-skin-registration/src/grok/tests/directive/skindirectiveonaclass_fixture.py
  A   grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/
  A   grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/__init__.py
  A   grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skinclass_conflict.py
  A   grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirective.py
  A   grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirective_fixture.py
  A   grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirectiveonaclass_fixture.py
  U   grok/branches/jw-simpler-skin-registration/src/grok/tests/test_grok.py

-=-
Deleted: grok/branches/jw-simpler-skin-registration/src/grok/tests/conflict/skin.py
===================================================================
--- grok/branches/jw-simpler-skin-registration/src/grok/tests/conflict/skin.py	2008-08-01 13:00:27 UTC (rev 89142)
+++ grok/branches/jw-simpler-skin-registration/src/grok/tests/conflict/skin.py	2008-08-01 13:04:13 UTC (rev 89143)
@@ -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.Skin):
-    grok.name('foo')
-
-class Skin2(grok.Skin):
-    grok.name('foo')

Deleted: grok/branches/jw-simpler-skin-registration/src/grok/tests/directive/skindirective.py
===================================================================
--- grok/branches/jw-simpler-skin-registration/src/grok/tests/directive/skindirective.py	2008-08-01 13:00:27 UTC (rev 89142)
+++ grok/branches/jw-simpler-skin-registration/src/grok/tests/directive/skindirective.py	2008-08-01 13:04:13 UTC (rev 89143)
@@ -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.directive 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.directive 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/directive/skindirective_fixture.py
===================================================================
--- grok/branches/jw-simpler-skin-registration/src/grok/tests/directive/skindirective_fixture.py	2008-08-01 13:00:27 UTC (rev 89142)
+++ grok/branches/jw-simpler-skin-registration/src/grok/tests/directive/skindirective_fixture.py	2008-08-01 13:04:13 UTC (rev 89143)
@@ -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/directive/skindirectiveonaclass_fixture.py
===================================================================
--- grok/branches/jw-simpler-skin-registration/src/grok/tests/directive/skindirectiveonaclass_fixture.py	2008-08-01 13:00:27 UTC (rev 89142)
+++ grok/branches/jw-simpler-skin-registration/src/grok/tests/directive/skindirectiveonaclass_fixture.py	2008-08-01 13:04:13 UTC (rev 89143)
@@ -1,4 +0,0 @@
-import grok
-
-class NotAnInterfaceClass(object):
-    grok.skin('failing_directive')

Added: grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/__init__.py
===================================================================
--- grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/__init__.py	                        (rev 0)
+++ grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/__init__.py	2008-08-01 13:04:13 UTC (rev 89143)
@@ -0,0 +1 @@
+# Make this directory a Python package


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

Copied: grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skinclass_conflict.py (from rev 89141, grok/branches/jw-simpler-skin-registration/src/grok/tests/conflict/skin.py)
===================================================================
--- grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skinclass_conflict.py	                        (rev 0)
+++ grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skinclass_conflict.py	2008-08-01 13:04:13 UTC (rev 89143)
@@ -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.Skin):
+    grok.name('foo')
+
+class Skin2(grok.Skin):
+    grok.name('foo')

Copied: grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirective.py (from rev 89128, grok/branches/jw-simpler-skin-registration/src/grok/tests/directive/skindirective.py)
===================================================================
--- grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirective.py	                        (rev 0)
+++ grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirective.py	2008-08-01 13:04:13 UTC (rev 89143)
@@ -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 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'
+
+"""

Copied: grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirective_fixture.py (from rev 89128, grok/branches/jw-simpler-skin-registration/src/grok/tests/directive/skindirective_fixture.py)
===================================================================
--- grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirective_fixture.py	                        (rev 0)
+++ grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirective_fixture.py	2008-08-01 13:04:13 UTC (rev 89143)
@@ -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/skindirectiveonaclass_fixture.py (from rev 89128, grok/branches/jw-simpler-skin-registration/src/grok/tests/directive/skindirectiveonaclass_fixture.py)
===================================================================
--- grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirectiveonaclass_fixture.py	                        (rev 0)
+++ grok/branches/jw-simpler-skin-registration/src/grok/tests/skin/skindirectiveonaclass_fixture.py	2008-08-01 13:04:13 UTC (rev 89143)
@@ -0,0 +1,4 @@
+import grok
+
+class NotAnInterfaceClass(object):
+    grok.skin('failing_directive')

Modified: grok/branches/jw-simpler-skin-registration/src/grok/tests/test_grok.py
===================================================================
--- grok/branches/jw-simpler-skin-registration/src/grok/tests/test_grok.py	2008-08-01 13:00:27 UTC (rev 89142)
+++ grok/branches/jw-simpler-skin-registration/src/grok/tests/test_grok.py	2008-08-01 13:04:13 UTC (rev 89143)
@@ -44,7 +44,7 @@
     suite = unittest.TestSuite()
     for name in ['adapter', 'error', 'view', 'event', 'security', 'catalog',
                  'zcml', 'static', 'utility', 'xmlrpc', 'json', 'container',
-                 'traversal', 'form', 'grokker', 'directive',
+                 'traversal', 'form', 'grokker', 'directive', 'skin',
                  'baseclass', 'annotation', 'application', 'template',
                  'viewlet', 'testsetup', 'conflict', 'order']:
         suite.addTest(suiteFromPackage(name))



More information about the Checkins mailing list