[Checkins] SVN: Sandbox/cklinger/pytt/ new checkpoint

Christian Klinger cklinger at novareto.de
Wed Jan 19 08:45:49 EST 2011


Log message for revision 119705:
  new checkpoint

Changed:
  U   Sandbox/cklinger/pytt/buildout.cfg
  U   Sandbox/cklinger/pytt/setup.py
  U   Sandbox/cklinger/pytt/src/pytt/app.txt
  A   Sandbox/cklinger/pytt/src/pytt/conftest.py
  U   Sandbox/cklinger/pytt/src/pytt/tests/test_functional.py
  U   Sandbox/cklinger/pytt/src/pytt/tests/test_integration.py

-=-
Modified: Sandbox/cklinger/pytt/buildout.cfg
===================================================================
--- Sandbox/cklinger/pytt/buildout.cfg	2011-01-19 13:37:47 UTC (rev 119704)
+++ Sandbox/cklinger/pytt/buildout.cfg	2011-01-19 13:45:49 UTC (rev 119705)
@@ -3,7 +3,7 @@
 extends-cache = extends-cache
 find-links = 
     http://grok.zope.org/releaseinfo/1.2.1/eggs
-    http://pypi.testrun.org/simple/py/
+#    http://pypi.testrun.org/simple/py/
 include-site-packages = false
 develop = .
 unzip = true
@@ -47,16 +47,14 @@
 eggs =
   pytt
   pytest
-entry-points =
-  pytest=pytest:main
-arguments = ['src/pytt', ]
+arguments = ['src/pytt'] + sys.argv[1:]
 
+
 [versions]
 # Override versions here.
 # This version pin can be removed after the next groktoolkit release.
 collective.recipe.scriptgen = 0.2
 py = 1.4.0a2
-lxml = 2.2.2
 
 
 [app]

Modified: Sandbox/cklinger/pytt/setup.py
===================================================================
--- Sandbox/cklinger/pytt/setup.py	2011-01-19 13:37:47 UTC (rev 119704)
+++ Sandbox/cklinger/pytt/setup.py	2011-01-19 13:45:49 UTC (rev 119705)
@@ -22,8 +22,8 @@
       install_requires=['setuptools',
                         'grok',
                         'grokui.admin',
-                        'z3c.testsetup',
                         'grokcore.startup',
+                        #'zope.app.testing',
                         'zope.pytest',
                         'infrae.testbrowser',
                         # Add extra requirements here

Modified: Sandbox/cklinger/pytt/src/pytt/app.txt
===================================================================
--- Sandbox/cklinger/pytt/src/pytt/app.txt	2011-01-19 13:37:47 UTC (rev 119704)
+++ Sandbox/cklinger/pytt/src/pytt/app.txt	2011-01-19 13:45:49 UTC (rev 119705)
@@ -1,14 +1,11 @@
 Do a functional doctest test on the app.
 ========================================
 
-.. :doctest:
-.. :layer: pytt.tests.browser_layer
-
 Let's first create an instance of Pytt at the top level:
 
-    >>> from pytt.app import Pytt
-    >>> root = getRootFolder()
-    >>> root['app'] = Pytt()
+    >>> from pytt.app import Example 
+    >>> from zope.pytest import create_app, setup_config
+    >>> import pytt
 
 Run tests in the testbrowser
 ----------------------------
@@ -20,27 +17,14 @@
 
 Create a browser and visit the instance you just created:
 
-    >>> from zope.app.wsgi.testlayer import Browser
-    >>> browser = Browser()
-    >>> browser.open('http://localhost/app')
+    >>> 1+1
+    2
 
+    >>> # from infrae.testbrowser.browser import Browser
+    >>> # app = Example
+    >>> # browser = Browser(app)
+    >>> # browser.open('http://localhost/app')
+
 Check some basic information about the page you visit:
 
-    >>> browser.url
-    'http://localhost/app'
-
-    >>> print browser.contents
-    <html>
-    <head>
-    <base href="http://localhost/app/@@index" />
-    <BLANKLINE>
-    </head>
-    <body>
-      <h1>Congratulations!</h1>
-    <BLANKLINE>
-      <p>Your Grok application is up and running.
-      Edit <code>pytt/app_templates/index.pt</code> to change
-      this page.</p>
-    </body>
-    </html>
-    <BLANKLINE>
+    >>> # browser.url

Added: Sandbox/cklinger/pytt/src/pytt/conftest.py
===================================================================
--- Sandbox/cklinger/pytt/src/pytt/conftest.py	                        (rev 0)
+++ Sandbox/cklinger/pytt/src/pytt/conftest.py	2011-01-19 13:45:49 UTC (rev 119705)
@@ -0,0 +1,14 @@
+
+import pytt 
+import pytest
+
+from pytt.app import Example
+from zope.pytest import create_app, configure
+
+
+def pytest_funcarg__app(request):
+    return create_app(request, Example())
+
+def pytest_funcarg__config(request):
+    return configure(request, pytt, 'ftesting.zcml')
+

Modified: Sandbox/cklinger/pytt/src/pytt/tests/test_functional.py
===================================================================
--- Sandbox/cklinger/pytt/src/pytt/tests/test_functional.py	2011-01-19 13:37:47 UTC (rev 119704)
+++ Sandbox/cklinger/pytt/src/pytt/tests/test_functional.py	2011-01-19 13:45:49 UTC (rev 119705)
@@ -8,21 +8,16 @@
 from zope import component
 from pytt.app import Example
 from zope.publisher.browser import TestRequest
-from zope.pytest import create_app, configure, argument
+from zope.pytest import create_app, configure
 
 from infrae.testbrowser.browser import Browser
 
+#def pytest_funcarg__app(request):
+#    return create_app(request, Example())
+#
+#def pytest_funcarg__config(request):
+#    return configure(request, pytt, 'ftesting.zcml')
 
-request = TestRequest()
-
- at argument
-def app(request):
-    return create_app(request, Example())
-
- at argument
-def config(request):
-    return configure(request, pytt, 'ftesting.zcml')
-
 def test_with_infrae_testbrowser(config, app):
     browser = Browser(app)
     browser.options.handle_errors = False

Modified: Sandbox/cklinger/pytt/src/pytt/tests/test_integration.py
===================================================================
--- Sandbox/cklinger/pytt/src/pytt/tests/test_integration.py	2011-01-19 13:37:47 UTC (rev 119704)
+++ Sandbox/cklinger/pytt/src/pytt/tests/test_integration.py	2011-01-19 13:45:49 UTC (rev 119705)
@@ -8,22 +8,18 @@
 from zope import component
 from pytt.app import Example
 from zope.publisher.browser import TestRequest
-from zope.pytest import create_app, configure, argument
+from zope.pytest import create_app, configure
 
-from infrae.testbrowser.browser import Browser
 
+#def pytest_funcarg__app(request):
+#    return create_app(request, Example())
+#
+#def pytest_funcarg__config(request):
+#    return configure(request, pytt, 'ftesting.zcml')
 
-request = TestRequest()
+zope_req = TestRequest()
 
- at argument
-def app(request):
-    return create_app(request, Example())
-
- at argument
-def config(request):
-    return configure(request, pytt, 'ftesting.zcml')
-
-def test_integration(config, app):
+def test_integration(app, config):
     view = component.getMultiAdapter(
-        (Example(), request), name=u"index")
+        (Example(), zope_req), name=u"index")
     assert "Congratulations" in view()



More information about the checkins mailing list