Skip to content

Commit

Permalink
Add more vebosity when test fail.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkiro committed Jul 11, 2014
1 parent cc84ed0 commit 2e06dee
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/unit/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,13 @@ def check_response(self, handler):
response = response.decode("utf8").replace("\n\n", "\n")

result = {}
for line in response.splitlines():
key = line.split(":", 1)[0].strip()
value = line.split(":")[1].strip()
result[key] = value
try:
for line in response.splitlines():
key = line.split(":", 1)[0].strip()
value = line.split(":")[1].strip()
result[key] = value
except (IndexError, TypeError) as e:
self.fail("Error parsing %r: %s" % (response, e))

self.assertEqual(result, self.expected_response)

Expand Down

0 comments on commit 2e06dee

Please sign in to comment.