<?xml version="1.0" encoding="UTF-8" ?>
<rdf:RDF xmlns="http://usefulinc.com/ns/doap#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Project><name>van.testing</name>
<shortdesc>Layers for zope.testing to simplify test setups</shortdesc>
<description>.. contents::

van.testing provides tools for testing zope3/WSGI based applications that do
not use the ZODB or local utilities.

Testing Utilities
-----------------

The most common use of this testing module is functional testing zope
applications. It provides tools to setup layers which load the configuration
ZCML as well as setting up wsgi_intercept in a layer.

This test is part of such a layer (setup in van.testing.tests.FunctionalLayer):

    &gt;&gt;&gt; from wsgi_intercept import WSGI_HTTPConnection as HTTPConnection
    &gt;&gt;&gt; conn = HTTPConnection('localhost', 80)

    &gt;&gt;&gt; conn.request('GET', '/')
    &gt;&gt;&gt; r = conn.getresponse()
    &gt;&gt;&gt; print r.read() # doctest: +ELLIPSIS
    {'HTTP_ACCEPT_ENCODING': 'identity',
     'HTTP_HOST': 'localhost',
     'PATH_INFO': '/',
     'QUERY_STRING': '',
     'REMOTE_ADDR': '127.0.0.1',
     'REQUEST_METHOD': 'GET',
     'SCRIPT_NAME': '',
     'SERVER_NAME': 'localhost',
     'SERVER_PORT': '80',
     'SERVER_PROTOCOL': 'HTTP/1.1\r\n',
     'wsgi.errors': &lt;cStringIO.StringO object at ...&gt;,
     'wsgi.input': &lt;cStringIO.StringI object at ...&gt;,
     'wsgi.multiprocess': 0,
     'wsgi.multithread': 0,
     'wsgi.run_once': 0,
     'wsgi.url_scheme': 'http',
     'wsgi.version': (1, 0)}
    Marker: MARKER

Layers
------

Some basic layers useful for making test setups.

    &gt;&gt;&gt; import os.path
    &gt;&gt;&gt; from van.testing.layer import zcml_layer, null_layer

A zcml layer which sets up and tears down a zcml test harness (but is much
simpler than that provided with zope.app.functional):

    &gt;&gt;&gt; class ZCMLLayer:
    ...     zcml = os.path.join(os.path.dirname(__file__), 'ftesting.zcml')
    &gt;&gt;&gt; zcml_layer(ZCMLLayer)

Some default layers are provided for use with zope.testing, a "null" layer that
specifically does nothing. This is useful for layers which inherit from other
layers but where you don't want setup/teardown functions run twice (is this a
zope.testing bug?):

    &gt;&gt;&gt; class ExampleNullLayer(ZCMLLayer):
    ...     pass
    &gt;&gt;&gt; null_layer(ExampleNullLayer)


Changes
=======

3.0.0 (unknown)
------------------

- Allow users to specify the domain and port of the wsgi_intercept_layer by
  adding those attributes to the class.
- Fix testbrowser support a bit so that it performs more like
  zope.testbrowser.testing.Browser.
- Remove support for local component registrys (zope.site). This brings in the
  whole ZODB as zope.site's tests currently depend on it.

2.0.0 (2009-04-01)
------------------

- Remove dependencies by using zope.configuration.xmlconfig to setup zcml
  rather than zope.app.appsetup.  This leaves out some security configuration
  but the win from less dependencies is massive. In my tests, no tests had any
  issues with this.
- Add a wsgi_intercept layer and a functional_layer that combines both zcml
  and wsgi_intercept layer.

1.0.0 (2008-11-21)
------------------

- Initial Release</description>
<homepage rdf:resource="http://pypi.python.org/pypi/van.testing" />
<maintainer><foaf:Person><foaf:name>Vanguardistas LLC</foaf:name>
<foaf:mbox_sha1sum>2a5d53de05a9e41953ed1826447b07e9a7fa1525</foaf:mbox_sha1sum></foaf:Person></maintainer>
<release><Version><revision>2.0.1</revision></Version></release>
</Project></rdf:RDF>