view tests/test_fileapp.txt @ 29:d8b73d9b679d

separate testing fileapp to its own doctest file
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 05 Mar 2012 13:27:06 -0800
parents
children 52103702a732
line wrap: on
line source

Test FileApp
============

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