Skip to content

Commit 996579f

Browse files
author
Laurynas Butkus
committed
Adjust UploadIO spec
1 parent 19e8386 commit 996579f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

convertapi/format_detector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ def detect(resource):
1010
else:
1111
path = utils.urlparse(resource).path
1212

13-
return splitext(path)[1][1:].lower()
13+
return splitext(path)[1][1:].lower()

tests/test_convertapi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_convert_url(self):
2727
assert result.conversion_cost > 0
2828

2929
def test_upload_io(self):
30-
string_io = io.StringIO(u'test')
31-
upload_io = convertapi.UploadIO(string_io, 'test.txt')
30+
bytes_io = io.BytesIO(b'test')
31+
upload_io = convertapi.UploadIO(bytes_io, 'test.txt')
3232
result = convertapi.convert('pdf', { 'File': upload_io })
33-
assert result.conversion_cost > 0
33+
assert result.conversion_cost > 0

0 commit comments

Comments
 (0)