Skip to content

Commit e4c115f

Browse files
committed
Fix unit test
1 parent 0ae1797 commit e4c115f

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

README.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
Exonet API python package
22
=========================
3+
Python 3 library for the Exonet API.
34

45
.. image:: https://img.shields.io/pypi/v/exonetapi.svg?style=flat-square
56
.. image:: https://img.shields.io/pypi/pyversions/exonetapi.svg?style=flat-square
67
.. image:: https://img.shields.io/lgtm/grade/python/g/exonet/exonet-api-python.svg
78
:target: https://lgtm.com/projects/g/exonet/exonet-api-python/context:python
89
.. image:: https://img.shields.io/pypi/l/exonetapi.svg?style=flat-square
910

10-
Python 3 library for the Exonet API.
11-
1211
Conventions
1312
-----------
1413

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
'Topic :: Software Development :: Libraries :: Python Modules',
4141
'License :: OSI Approved :: MIT License',
4242
'Programming Language :: Python :: 3.4',
43-
'Programming Language :: Python :: 3.6',
43+
'Programming Language :: Python :: 3.9',
4444
],
4545

4646
packages=find_packages(exclude=['contrib', 'docs', 'tests']),

tests/result/testParser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_parse_list(self):
5151
}
5252
"""
5353

54-
result = Parser(json_data_list).parse().resources()
54+
result = Parser(str.encode(json_data_list)).parse().resources()
5555

5656
self.assertEqual(result[0].id(), 'DV6axK4GwNEb')
5757
self.assertEqual(result[0].type(), 'comments')
@@ -85,7 +85,7 @@ def test_parse_single(self):
8585
}
8686
"""
8787

88-
result = Parser(json_data_list).parse()
88+
result = Parser(str.encode(json_data_list)).parse()
8989

9090
self.assertEqual(result.id(), 'DV6axK4GwNEb')
9191
self.assertEqual(result.type(), 'comments')
@@ -121,7 +121,7 @@ def test_parse_single_with_multi_relation(self):
121121
}
122122
"""
123123

124-
result = Parser(json_data_list).parse().relationship('tags').get_resource_identifiers()
124+
result = Parser(str.encode(json_data_list)).parse().relationship('tags').get_resource_identifiers()
125125

126126
self.assertEqual(len(result), 2)
127127

tests/testRequestBuilder.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,19 +284,19 @@ def test_post_validation_error(self, mock_validation_exception, mock_requests_re
284284
def test_get_recursive(self, mock_requests_request):
285285
result_one = Response()
286286
result_one.status_code = 200
287-
result_one._content = '{"data": ' \
287+
result_one._content = str.encode('{"data": ' \
288288
'[{"type": "test", "id": "abc"}], ' \
289289
'"meta": {"total": 2}, ' \
290290
'"links": {"next": "https://api.exonet.nl/next_page"}' \
291-
'}'
291+
'}')
292292

293293
result_two = Response()
294294
result_two.status_code = 200
295-
result_two._content = '{"data": ' \
295+
result_two._content = str.encode('{"data": ' \
296296
'[{"type": "test", "id": "def"}], ' \
297297
'"meta": {"total": 2}, ' \
298298
'"links": {"next": null}' \
299-
'}'
299+
'}')
300300

301301
request_result = [result_one, result_two]
302302
mock_requests_request.side_effect = request_result

0 commit comments

Comments
 (0)