diff options
author | Helmut Grohne <helmut@subdivi.de> | 2007-04-21 20:48:43 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2007-04-21 20:48:43 +0200 |
commit | 5b5b4992ffdc3c3dc3b28c004f211288fb6affcf (patch) | |
tree | 8b2b1ac20aaea7d988ea7189cbf31d8617c66e61 /wsgitools/applications.py | |
parent | 5835a547893a7e89ef19e1e4e0b270b78c814a28 (diff) | |
download | wsgitools-5b5b4992ffdc3c3dc3b28c004f211288fb6affcf.tar.gz |
added some assertions
Diffstat (limited to 'wsgitools/applications.py')
-rw-r--r-- | wsgitools/applications.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/wsgitools/applications.py b/wsgitools/applications.py index 4ddf7ea..5ef2e8a 100644 --- a/wsgitools/applications.py +++ b/wsgitools/applications.py @@ -8,6 +8,9 @@ class StaticContent: content contains the data to be delivered to the client. It is either a string or some kind of iterable yielding strings. """ + assert isinstance(status, str) + assert isinstance(headers, list) + assert hasattr(content, "__iter__") self.status = status self.headers = headers length = -1 @@ -23,6 +26,7 @@ class StaticContent: headers.append(("Content-length", str(length))) def __call__(self, environ, start_response): """wsgi interface""" + assert isinstance(environ, dict) start_response(self.status, self.headers) if environ["REQUEST_METHOD"].upper() == "HEAD": return [] |