diff options
author | Ryan Petrello <lists@ryanpetrello.com> | 2012-03-23 12:22:43 -0400 |
---|---|---|
committer | Ryan Petrello <lists@ryanpetrello.com> | 2012-03-23 12:22:43 -0400 |
commit | bf22e788f86682d399e2d6f23cb874949e1bbfa0 (patch) | |
tree | 5a77f2a50479f6a89ac02ab2486216b047a1e11c /pecan/testing.py | |
parent | 5948f26ceaf55e16aca622a490ceff9ee0a8ff72 (diff) | |
download | pecan-bf22e788f86682d399e2d6f23cb874949e1bbfa0.tar.gz |
Inline docs for ``pecan.testing``.
Diffstat (limited to 'pecan/testing.py')
-rw-r--r-- | pecan/testing.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pecan/testing.py b/pecan/testing.py index cb7d09c..e846e35 100644 --- a/pecan/testing.py +++ b/pecan/testing.py @@ -3,4 +3,22 @@ from webtest import TestApp def load_test_app(config): + """ + Used for functional tests where you need to test your + literal application and its integration with the framework. + + :param config: Can be a dictionary containing configuration, or a string + which represents a (relative) configuration filename. + + returns a pecan.Pecan WSGI application wrapped in a webtest.TestApp + instance. + :: + app = load_test_app('path/to/some/config.py') + + resp = app.get('/path/to/some/resource').status_int + assert resp.status_int == 200 + + resp = app.post('/path/to/some/resource', params={'param': 'value'}) + assert resp.status_int == 302 + """ return TestApp(load_app(config)) |