From 8245b1ef9bfbe5b61a3e2c7657ec1377cbbb975e Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Wed, 1 Jun 2011 15:12:21 +0200 Subject: 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. --- test.py | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v1.2.3