Commit a5acdd45 by Qubad786

add fixes

parent 4d949706
......@@ -87,7 +87,7 @@ class ThreePlayMediaClientTests(TestCase):
responses.add(
responses.POST,
u'https://api.3playmedia.com/files',
body=u'000-111-222',
body=u'111222',
status=200
)
......
......@@ -111,15 +111,14 @@ class ThreePLayMediaClient(object):
)
)
try:
# A normal response should be a text containing file id and if we're getting a deserializable dict, there
# must be an error: http://support.3playmedia.com/hc/en-us/articles/227729828-Files-API-Methods
if isinstance(json.loads(response.text), dict):
raise ThreePlayMediaPerformTranscriptionError(
'Expected file id but got: {response}'.format(response=response.text)
)
except ValueError:
return response.text
# A normal response should be a text containing file id and if we're getting a deserializable dict, there
# must be an error: http://support.3playmedia.com/hc/en-us/articles/227729828-Files-API-Methods
if isinstance(json.loads(response.text), dict):
raise ThreePlayMediaPerformTranscriptionError(
'Expected file id but got: {response}'.format(response=response.text)
)
return response.text
def generate_transcripts(self):
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment