TTS Component / Google speech platform (#4837)

* TTS Component / Google speech platform

* Change file backend handling / cache

* Use mimetype / rename Provider function / allow cache on service call

* Add a memcache for faster response

* Add demo platform

* First version of unittest

* Address comments

* improve error handling / address comments

* Add google unittest & check http response code

* Change url param handling

* add test for other language

* Change hash to sha256 for same hash on every os/hardware

* add unittest for receive demo data

* add test for error cases

* Test case load from file to mem over aiohttp server

* Use cache SpeechManager level, address other comments

* Add service for clear cache

* Update service.yaml

* add support for spliting google message
This commit is contained in:
Pascal Vizeli authored and Paulus Schoutsen committed 2016-12-12 23:23:08 -08:00
1 parent acb841a1f4
commit 2dec38d8d4
11 files changed
+1110 -5

No files matched your search

+5 -4
View File
@@ -23,6 +23,7 @@ class AiohttpClientMocker:
content=None,
json=None,
params=None,
headers=None,
exc=None):
"""Mock a request."""
if json:
@@ -65,8 +66,8 @@ class AiohttpClientMocker:
return len(self.mock_calls)
@asyncio.coroutine
def match_request(self, method, url, *, auth=None, params=None): \
# pylint: disable=unused-variable
def match_request(self, method, url, *, auth=None, params=None,
headers=None): # pylint: disable=unused-variable
"""Match a request against pre-registered requests."""
for response in self._mocks:
if response.match_request(method, url, params):
@@ -76,8 +77,8 @@ class AiohttpClientMocker:
raise self.exc
return response
assert False, "No mock registered for {} {}".format(method.upper(),
url)
assert False, "No mock registered for {} {} {}".format(method.upper(),
url, params)
class AiohttpClientMockResponse: