summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2011-06-01 15:12:21 +0200
committerHelmut Grohne <helmut@subdivi.de>2011-06-01 15:12:21 +0200
commit8245b1ef9bfbe5b61a3e2c7657ec1377cbbb975e (patch)
treeffc0a4d6d0c8c864d15adeafc1bff433a8653ddb /test.py
parent04c0db2f095249c44042afd449266e00b18c5a4e (diff)
downloadwsgitools-8245b1ef9bfbe5b61a3e2c7657ec1377cbbb975e.tar.gz
test.py: improved header check
It previously only checked for the validity of a header and now also checks for the presence of a header.
Diffstat (limited to 'test.py')
-rwxr-xr-xtest.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/test.py b/test.py
index 13b7fb2..c9bab38 100755
--- a/test.py
+++ b/test.py
@@ -119,12 +119,16 @@ class Result:
@type name: str
@type check: str or (str -> bool)
"""
+ found = False
for key, value in self.headersdata:
if key == name:
+ found = True
if isinstance(check, str):
self.testcase.assertEqual(check, value)
else:
self.testcase.assert_(check(value))
+ if not found:
+ self.testcase.fail("header %s not found" % name)
from wsgitools import applications