Grammar and spelling fixes (#16065)

This commit is contained in:
Ville Skyttä authored and Fabian Affolter committed 2018-08-19 22:29:08 +02:00
1 parent 9e1fa7ef42
commit dbd0763f83
244 files changed
+453 -453

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ class TestTTSGooglePlatform:
"""Test the Google speech component."""
def setup_method(self):
"""Setup things to be run when tests are started."""
"""Set up things to be run when tests are started."""
self.hass = get_test_home_assistant()
self.url = "https://translate.google.com/translate_tts"
+23 -23
View File
@@ -33,7 +33,7 @@ class TestTTS:
"""Test the Google speech component."""
def setup_method(self):
"""Setup things to be run when tests are started."""
"""Set up things to be run when tests are started."""
self.hass = get_test_home_assistant()
self.demo_provider = DemoProvider('en')
self.default_tts_cache = self.hass.config.path(tts.DEFAULT_CACHE_DIR)
@@ -50,7 +50,7 @@ class TestTTS:
shutil.rmtree(self.default_tts_cache)
def test_setup_component_demo(self):
"""Setup the demo platform with defaults."""
"""Set up the demo platform with defaults."""
config = {
tts.DOMAIN: {
'platform': 'demo',
@@ -65,7 +65,7 @@ class TestTTS:
@patch('os.mkdir', side_effect=OSError(2, "No access"))
def test_setup_component_demo_no_access_cache_folder(self, mock_mkdir):
"""Setup the demo platform with defaults."""
"""Set up the demo platform with defaults."""
config = {
tts.DOMAIN: {
'platform': 'demo',
@@ -78,7 +78,7 @@ class TestTTS:
assert not self.hass.services.has_service(tts.DOMAIN, 'clear_cache')
def test_setup_component_and_test_service(self):
"""Setup the demo platform and call service."""
"""Set up the demo platform and call service."""
calls = mock_service(self.hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {
@@ -106,7 +106,7 @@ class TestTTS:
"265944c108cbb00b2a621be5930513e03a0bb2cd_en_-_demo.mp3"))
def test_setup_component_and_test_service_with_config_language(self):
"""Setup the demo platform and call service."""
"""Set up the demo platform and call service."""
calls = mock_service(self.hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {
@@ -135,7 +135,7 @@ class TestTTS:
"265944c108cbb00b2a621be5930513e03a0bb2cd_de_-_demo.mp3"))
def test_setup_component_and_test_service_with_wrong_conf_language(self):
"""Setup the demo platform and call service with wrong config."""
"""Set up the demo platform and call service with wrong config."""
config = {
tts.DOMAIN: {
'platform': 'demo',
@@ -147,7 +147,7 @@ class TestTTS:
setup_component(self.hass, tts.DOMAIN, config)
def test_setup_component_and_test_service_with_service_language(self):
"""Setup the demo platform and call service."""
"""Set up the demo platform and call service."""
calls = mock_service(self.hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {
@@ -176,7 +176,7 @@ class TestTTS:
"265944c108cbb00b2a621be5930513e03a0bb2cd_de_-_demo.mp3"))
def test_setup_component_test_service_with_wrong_service_language(self):
"""Setup the demo platform and call service."""
"""Set up the demo platform and call service."""
calls = mock_service(self.hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {
@@ -200,7 +200,7 @@ class TestTTS:
"265944c108cbb00b2a621be5930513e03a0bb2cd_lang_-_demo.mp3"))
def test_setup_component_and_test_service_with_service_options(self):
"""Setup the demo platform and call service with options."""
"""Set up the demo platform and call service with options."""
calls = mock_service(self.hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {
@@ -237,7 +237,7 @@ class TestTTS:
@patch('homeassistant.components.tts.demo.DemoProvider.default_options',
new_callable=PropertyMock(return_value={'voice': 'alex'}))
def test_setup_component_and_test_with_service_options_def(self, def_mock):
"""Setup the demo platform and call service with default options."""
"""Set up the demo platform and call service with default options."""
calls = mock_service(self.hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {
@@ -269,7 +269,7 @@ class TestTTS:
opt_hash)))
def test_setup_component_and_test_service_with_service_options_wrong(self):
"""Setup the demo platform and call service with wrong options."""
"""Set up the demo platform and call service with wrong options."""
calls = mock_service(self.hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {
@@ -299,7 +299,7 @@ class TestTTS:
opt_hash)))
def test_setup_component_and_test_service_clear_cache(self):
"""Setup the demo platform and call service clear cache."""
"""Set up the demo platform and call service clear cache."""
calls = mock_service(self.hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {
@@ -329,7 +329,7 @@ class TestTTS:
"265944c108cbb00b2a621be5930513e03a0bb2cd_en_-_demo.mp3"))
def test_setup_component_and_test_service_with_receive_voice(self):
"""Setup the demo platform and call service and receive voice."""
"""Set up the demo platform and call service and receive voice."""
calls = mock_service(self.hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {
@@ -359,7 +359,7 @@ class TestTTS:
assert req.content == demo_data
def test_setup_component_and_test_service_with_receive_voice_german(self):
"""Setup the demo platform and call service and receive voice."""
"""Set up the demo platform and call service and receive voice."""
calls = mock_service(self.hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {
@@ -390,7 +390,7 @@ class TestTTS:
assert req.content == demo_data
def test_setup_component_and_web_view_wrong_file(self):
"""Setup the demo platform and receive wrong file from web."""
"""Set up the demo platform and receive wrong file from web."""
config = {
tts.DOMAIN: {
'platform': 'demo',
@@ -409,7 +409,7 @@ class TestTTS:
assert req.status_code == 404
def test_setup_component_and_web_view_wrong_filename(self):
"""Setup the demo platform and receive wrong filename from web."""
"""Set up the demo platform and receive wrong filename from web."""
config = {
tts.DOMAIN: {
'platform': 'demo',
@@ -428,7 +428,7 @@ class TestTTS:
assert req.status_code == 404
def test_setup_component_test_without_cache(self):
"""Setup demo platform without cache."""
"""Set up demo platform without cache."""
calls = mock_service(self.hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {
@@ -452,7 +452,7 @@ class TestTTS:
"265944c108cbb00b2a621be5930513e03a0bb2cd_en_-_demo.mp3"))
def test_setup_component_test_with_cache_call_service_without_cache(self):
"""Setup demo platform with cache and call service without cache."""
"""Set up demo platform with cache and call service without cache."""
calls = mock_service(self.hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {
@@ -477,7 +477,7 @@ class TestTTS:
"265944c108cbb00b2a621be5930513e03a0bb2cd_en_-_demo.mp3"))
def test_setup_component_test_with_cache_dir(self):
"""Setup demo platform with cache and call service without cache."""
"""Set up demo platform with cache and call service without cache."""
calls = mock_service(self.hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
_, demo_data = self.demo_provider.get_tts_audio("bla", 'en')
@@ -515,7 +515,7 @@ class TestTTS:
@patch('homeassistant.components.tts.demo.DemoProvider.get_tts_audio',
return_value=(None, None))
def test_setup_component_test_with_error_on_get_tts(self, tts_mock):
"""Setup demo platform with wrong get_tts_audio."""
"""Set up demo platform with wrong get_tts_audio."""
calls = mock_service(self.hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {
@@ -535,7 +535,7 @@ class TestTTS:
assert len(calls) == 0
def test_setup_component_load_cache_retrieve_without_mem_cache(self):
"""Setup component and load cache and get without mem cache."""
"""Set up component and load cache and get without mem cache."""
_, demo_data = self.demo_provider.get_tts_audio("bla", 'en')
cache_file = os.path.join(
self.default_tts_cache,
@@ -565,7 +565,7 @@ class TestTTS:
assert req.content == demo_data
def test_setup_component_and_web_get_url(self):
"""Setup the demo platform and receive wrong file from web."""
"""Set up the demo platform and receive wrong file from web."""
config = {
tts.DOMAIN: {
'platform': 'demo',
@@ -589,7 +589,7 @@ class TestTTS:
.format(self.hass.config.api.base_url))
def test_setup_component_and_web_get_url_bad_config(self):
"""Setup the demo platform and receive wrong file from web."""
"""Set up the demo platform and receive wrong file from web."""
config = {
tts.DOMAIN: {
'platform': 'demo',
+1 -1
View File
@@ -18,7 +18,7 @@ class TestTTSMaryTTSPlatform:
"""Test the speech component."""
def setup_method(self):
"""Setup things to be run when tests are started."""
"""Set up things to be run when tests are started."""
self.hass = get_test_home_assistant()
self.url = "http://localhost:59125/process?"
+1 -1
View File
@@ -18,7 +18,7 @@ class TestTTSVoiceRSSPlatform:
"""Test the voicerss speech component."""
def setup_method(self):
"""Setup things to be run when tests are started."""
"""Set up things to be run when tests are started."""
self.hass = get_test_home_assistant()
self.url = "https://api.voicerss.org/"
+1 -1
View File
@@ -17,7 +17,7 @@ class TestTTSYandexPlatform:
"""Test the speech component."""
def setup_method(self):
"""Setup things to be run when tests are started."""
"""Set up things to be run when tests are started."""
self.hass = get_test_home_assistant()
self._base_url = "https://tts.voicetech.yandex.net/generate?"