summaryrefslogtreecommitdiff
path: root/wsgitools/applications.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2007-04-21 20:48:43 +0200
committerHelmut Grohne <helmut@subdivi.de>2007-04-21 20:48:43 +0200
commit5b5b4992ffdc3c3dc3b28c004f211288fb6affcf (patch)
tree8b2b1ac20aaea7d988ea7189cbf31d8617c66e61 /wsgitools/applications.py
parent5835a547893a7e89ef19e1e4e0b270b78c814a28 (diff)
downloadwsgitools-5b5b4992ffdc3c3dc3b28c004f211288fb6affcf.tar.gz
added some assertions
Diffstat (limited to 'wsgitools/applications.py')
-rw-r--r--wsgitools/applications.py4
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 []