diff options
| -rw-r--r-- | docs/news.txt | 3 | ||||
| -rw-r--r-- | paste/fixture.py | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/docs/news.txt b/docs/news.txt index 483b72e..f98c4af 100644 --- a/docs/news.txt +++ b/docs/news.txt @@ -30,6 +30,9 @@ svn trunk than ``paste.fileapp.FileApp`` (if you subclass and override ``make_app``) +* ``paste.fixture.TestApp.get(status=X)`` takes a list of allowed + status codes for ``X``. + 1.1.1 ----- diff --git a/paste/fixture.py b/paste/fixture.py index 1ecd119..30fe781 100644 --- a/paste/fixture.py +++ b/paste/fixture.py @@ -373,6 +373,13 @@ class TestApp(object): __tracebackhide__ = True if status == '*': return + if isinstance(status, (list, tuple)): + if res.status not in status: + raise AppError( + "Bad response: %s (not one of %s for %s)\n%s" + % (res.full_status, ', '.join(map(str, status)), + res.request.url, res.body)) + return if status is None: if res.status == 200 or ( res.status >= 300 and res.status < 400): |
