[Checkins] SVN: z3c.testsetup/trunk/src/z3c/testsetup/tests/layered_cave/bar/ Add another complete test package with functional tests.

Uli Fouquet uli at gnufix.de
Mon May 4 10:45:11 EDT 2009


Log message for revision 99709:
  Add another complete test package with functional tests.

Changed:
  A   z3c.testsetup/trunk/src/z3c/testsetup/tests/layered_cave/bar/
  A   z3c.testsetup/trunk/src/z3c/testsetup/tests/layered_cave/bar/__init__.py
  A   z3c.testsetup/trunk/src/z3c/testsetup/tests/layered_cave/bar/anotherfunctionaldoctest.txt
  A   z3c.testsetup/trunk/src/z3c/testsetup/tests/layered_cave/bar/configure.zcml
  A   z3c.testsetup/trunk/src/z3c/testsetup/tests/layered_cave/bar/ftesting.zcml

-=-
Added: z3c.testsetup/trunk/src/z3c/testsetup/tests/layered_cave/bar/__init__.py
===================================================================
--- z3c.testsetup/trunk/src/z3c/testsetup/tests/layered_cave/bar/__init__.py	                        (rev 0)
+++ z3c.testsetup/trunk/src/z3c/testsetup/tests/layered_cave/bar/__init__.py	2009-05-04 14:45:11 UTC (rev 99709)
@@ -0,0 +1,12 @@
+
+import zope.interface
+
+class IBar(zope.interface.Interface):
+    def do_bar():
+        pass
+
+class BarUtility(object):
+    zope.interface.implements(IBar)
+    
+    def do_bar(self):
+        print "Bar!"

Added: z3c.testsetup/trunk/src/z3c/testsetup/tests/layered_cave/bar/anotherfunctionaldoctest.txt
===================================================================
--- z3c.testsetup/trunk/src/z3c/testsetup/tests/layered_cave/bar/anotherfunctionaldoctest.txt	                        (rev 0)
+++ z3c.testsetup/trunk/src/z3c/testsetup/tests/layered_cave/bar/anotherfunctionaldoctest.txt	2009-05-04 14:45:11 UTC (rev 99709)
@@ -0,0 +1,17 @@
+
+
+:doctest:
+:functional-zcml-layer: ftesting.zcml
+
+Only our local ftesting.zcml is considered during test runs:
+
+    >>> from zope.component import getUtility
+    >>> from z3c.testsetup.tests.layered_cave.bar import IBar
+    >>> getUtility(IBar, name='bar utility')().do_bar()
+    Bar!
+
+    >>> from z3c.testsetup.tests.layered_cave.foo import IFoo
+    >>> getUtility(IFoo, name='foo utility')
+    Traceback (most recent call last):
+    ...
+    ComponentLookupError: (<InterfaceClass ...foo.IFoo>, 'foo utility')

Added: z3c.testsetup/trunk/src/z3c/testsetup/tests/layered_cave/bar/configure.zcml
===================================================================
--- z3c.testsetup/trunk/src/z3c/testsetup/tests/layered_cave/bar/configure.zcml	                        (rev 0)
+++ z3c.testsetup/trunk/src/z3c/testsetup/tests/layered_cave/bar/configure.zcml	2009-05-04 14:45:11 UTC (rev 99709)
@@ -0,0 +1,4 @@
+<configure xmlns="http://namespaces.zope.org/zope">
+  <include package="zope.component" file="meta.zcml" />
+  <utility component=".BarUtility" provides=".IBar" name="bar utility" />
+</configure>

Added: z3c.testsetup/trunk/src/z3c/testsetup/tests/layered_cave/bar/ftesting.zcml
===================================================================
--- z3c.testsetup/trunk/src/z3c/testsetup/tests/layered_cave/bar/ftesting.zcml	                        (rev 0)
+++ z3c.testsetup/trunk/src/z3c/testsetup/tests/layered_cave/bar/ftesting.zcml	2009-05-04 14:45:11 UTC (rev 99709)
@@ -0,0 +1,3 @@
+<configure xmlns="http://namespaces.zope.org/zope" i18n_domain="zope">
+  <include package="z3c.testsetup.tests.layered_cave.bar" />
+</configure>



More information about the Checkins mailing list