[Checkins]
SVN: grok/branches/jw-philipp-using-ndir-directives/src/grok/ftests/
Move a test from Grok to grokcore.component that really
belongs there.
Philipp von Weitershausen
philikon at philikon.de
Sun May 4 10:25:30 EDT 2008
Log message for revision 86373:
Move a test from Grok to grokcore.component that really belongs there.
Changed:
D grok/branches/jw-philipp-using-ndir-directives/src/grok/ftests/grok_component.txt
U grok/branches/jw-philipp-using-ndir-directives/src/grok/ftests/test_grok_functional.py
-=-
Deleted: grok/branches/jw-philipp-using-ndir-directives/src/grok/ftests/grok_component.txt
===================================================================
--- grok/branches/jw-philipp-using-ndir-directives/src/grok/ftests/grok_component.txt 2008-05-04 14:25:22 UTC (rev 86372)
+++ grok/branches/jw-philipp-using-ndir-directives/src/grok/ftests/grok_component.txt 2008-05-04 14:25:29 UTC (rev 86373)
@@ -1,41 +0,0 @@
-Test grok_component() in an ordinary doctest.
-
-We already have tests for grok_component(), but these were placed
-inside a module. We will now test grok_component() in a pure doctest
-context. This used to demonstrate an error in martian when dealing
-with the __builtin__ module (fixed in martian 0.9.2).
-
-grok.testing.grok_component() can be used to grok individual
-components within a doctest, such as adapters. It sets up just enough
-context for some grokking to work, though more complicated grokkers
-which need module context (such as view grokkers) might not work.
-
-This defines the object we want to provide an adapter for::
-
- >>> class Bar(object):
- ... pass
-
-This is the interface that we want to adapt to::
-
- >>> from zope.interface import Interface
- >>> class IFoo(Interface):
- ... pass
-
-This is the adapter itself::
-
- >>> import grok
- >>> class MyAdapter(grok.Adapter):
- ... grok.provides(IFoo)
- ... grok.context(Bar)
-
-Now we will register the adapter using grok_component()::
-
- >>> from grok.testing import grok_component
- >>> grok_component('MyAdapter', MyAdapter)
- True
-
-The adapter should now be available::
-
- >>> adapted = IFoo(Bar())
- >>> isinstance(adapted, MyAdapter)
- True
Modified: grok/branches/jw-philipp-using-ndir-directives/src/grok/ftests/test_grok_functional.py
===================================================================
--- grok/branches/jw-philipp-using-ndir-directives/src/grok/ftests/test_grok_functional.py 2008-05-04 14:25:22 UTC (rev 86372)
+++ grok/branches/jw-philipp-using-ndir-directives/src/grok/ftests/test_grok_functional.py 2008-05-04 14:25:29 UTC (rev 86373)
@@ -73,13 +73,6 @@
'security', 'utility', 'catalog', 'admin', 'site', 'rest',
'viewlet']:
suite.addTest(suiteFromPackage(name))
-
- # this test cannot follow the normal testing pattern, as the
- # bug it tests for is only exposed in the context of a doctest
- grok_component = doctest.DocFileSuite('grok_component.txt')
- grok_component.layer = GrokFunctionalLayer
- suite.addTest(grok_component)
-
return suite
if __name__ == '__main__':
More information about the Checkins
mailing list