Ian Bicking: the old part of his blog

Re: Functional testing in Paste

Where does app come from?

From looking at the test I can't tell where app comes from.

I suppose it could be a good thing to write generic tests for multiple applications.

Perhaps explicitly tell it where the config file is?

However what is in this config file? If I was writing this test from scratch I'd need to know the config file format, and what needs to go in it.

Importing your app module directly might be the go to make it more explicit?

from paste.tests.fixture import *

import yourapp
app = yourapp.app

def test_index():
    res = app.get('/')
Comment on Functional testing in Paste
by Rene Dudfield


The configuration is a Paste configuration file, which describes an application. The configuration file is found in server.conf, and the fixture searches parent directories for such a file until it finds one.

The app object is actually paste.tests.fixture.TestApp(paste_app).

Generally this should work easily if you have your application set up to run in Paste. But not so easy otherwise. Hrm... and I don't think I really have good documentation for the configuration file at this time :(

# Ian Bicking