Skip to content

Commit ba7fd02

Browse files
committed
Fixing test for Python3.
1 parent f911a5f commit ba7fd02

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/unit/test_request.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,14 @@ def it_handles_no_encoding(self):
249249

250250
@istest
251251
def it_needs_encoding_or_apparent_encoding(self):
252+
payload = '{}'
253+
254+
if not hasattr(payload, 'decode'):
255+
# python 3
256+
payload = payload.encode('utf-8')
257+
252258
resp = mock_response(
253-
'{}', status_code=200, encoding=None, headers=None)
259+
payload, status_code=200, encoding=None, headers=None)
254260

255261
with patch('requests.request') as mock_method:
256262
mock_method.return_value = resp

0 commit comments

Comments
 (0)