Skip to content

Commit 0d75821

Browse files
committed
Cater for empty body
1 parent 00e55ce commit 0d75821

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

abe/unittest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from copy import copy
2-
from operator import attrgetter
32
import os
43

54
from .mocks import AbeMock
@@ -91,7 +90,7 @@ def assert_data_list_equal(self, data1, data2):
9190
fails.append(element)
9291
if not data1_elements:
9392
message = '\n*\n'.join(
94-
map(attrgetter('message'), exceptions)
93+
map(str, exceptions)
9594
)
9695
raise type(exceptions[0])(message)
9796
data1_elements.extend(fails)
@@ -115,4 +114,5 @@ def assert_matches_sample(self, path, label, url, response):
115114

116115
self.assertEqual(url, sample_request.url)
117116
self.assertEqual(response.status_code, sample_response.status)
118-
self.assert_data_equal(response.data, sample_response.body)
117+
if 'body' in sample_response:
118+
self.assert_data_equal(response.data, sample_response.body)

0 commit comments

Comments
 (0)