Skip to content

Commit

Permalink
pytest speech
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca-Fischer committed Mar 8, 2021
1 parent edc5eec commit f56533f
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 1 deletion.
Binary file added .DS_Store
Binary file not shown.
File renamed without changes.
Binary file modified myapi/common/__pycache__/speech_utility.cpython-38.pyc
Binary file not shown.
Binary file modified myapi/resources/__pycache__/speech.cpython-38.pyc
Binary file not shown.
4 changes: 3 additions & 1 deletion myapi/resources/speech.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
from flask_restful import Resource
from flask_restful import request

import base64
import common.speech_utility

class Speech(Resource):
def get(self):
var = common.speech_utility.text_to_speech("test")
args = request.args
var = common.speech_utility.text_to_speech(str(args))

return {"speech":str(base64.b64encode(var), 'ascii', 'ignore')}

Empty file added myapi/tests/__init__.py
Empty file.
9 changes: 9 additions & 0 deletions myapi/tests/test_speech.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import common.speech_utility
import base64

def test_connection():
var = str(base64.b64encode(common.speech_utility.text_to_speech("test")), 'ascii', 'ignore')
assert var.startswith("SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMAAAAAAAAAAAAAAA//")



0 comments on commit f56533f

Please sign in to comment.