view tests/doctest.txt @ 6:623358c3ebde

we has a passing test!
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 29 Feb 2012 14:44:04 -0800
parents 8d31e36f084e
children 4d1852cfc077
line wrap: on
line source

Test FileServer
================

The obligatory imports::

    >>> import fileserver
    >>> import os
    >>> from paste.fixture import TestApp

Make a single file server::

    >>> filename = os.path.join(here, 'example', 'helloworld.txt')
    >>> os.path.exists(filename)
    True
    >>> app = fileserver.FileApp(filename)
    >>> testapp = TestApp(app)
    >>> response = testapp.get('/')
    >>> response.status
    200
    >>> response.body == file(filename).read()
    True