From 5b5b4992ffdc3c3dc3b28c004f211288fb6affcf Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Sat, 21 Apr 2007 20:48:43 +0200 Subject: added some assertions --- wsgitools/applications.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'wsgitools/applications.py') 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 [] -- cgit v1.2.3