diff options
author | Helmut Grohne <helmut@subdivi.de> | 2011-06-01 15:12:21 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2011-06-01 15:12:21 +0200 |
commit | 8245b1ef9bfbe5b61a3e2c7657ec1377cbbb975e (patch) | |
tree | ffc0a4d6d0c8c864d15adeafc1bff433a8653ddb | |
parent | 04c0db2f095249c44042afd449266e00b18c5a4e (diff) | |
download | wsgitools-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.
-rwxr-xr-x | test.py | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 |