Grammar and spelling fixes (#16065)
This commit is contained in:
parent
9e1fa7ef42
commit
dbd0763f83
244 changed files with 453 additions and 453 deletions
|
@ -141,13 +141,13 @@ def test_valid_file_path():
|
|||
|
||||
|
||||
async def test_setup_platform(hass, mock_healthybox):
|
||||
"""Setup platform with one entity."""
|
||||
"""Set up platform with one entity."""
|
||||
await async_setup_component(hass, ip.DOMAIN, VALID_CONFIG)
|
||||
assert hass.states.get(VALID_ENTITY_ID)
|
||||
|
||||
|
||||
async def test_setup_platform_with_auth(hass, mock_healthybox):
|
||||
"""Setup platform with one entity and auth."""
|
||||
"""Set up platform with one entity and auth."""
|
||||
valid_config_auth = VALID_CONFIG.copy()
|
||||
valid_config_auth[ip.DOMAIN][CONF_USERNAME] = MOCK_USERNAME
|
||||
valid_config_auth[ip.DOMAIN][CONF_PASSWORD] = MOCK_PASSWORD
|
||||
|
@ -297,7 +297,7 @@ async def test_teach_service(
|
|||
|
||||
|
||||
async def test_setup_platform_with_name(hass, mock_healthybox):
|
||||
"""Setup platform with one entity and a name."""
|
||||
"""Set up platform with one entity and a name."""
|
||||
named_entity_id = 'image_processing.{}'.format(MOCK_NAME)
|
||||
|
||||
valid_config_named = VALID_CONFIG.copy()
|
||||
|
|
|
@ -16,7 +16,7 @@ class TestSetupImageProcessing:
|
|||
"""Test class for setup image processing."""
|
||||
|
||||
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()
|
||||
|
||||
def teardown_method(self):
|
||||
|
@ -24,7 +24,7 @@ class TestSetupImageProcessing:
|
|||
self.hass.stop()
|
||||
|
||||
def test_setup_component(self):
|
||||
"""Setup demo platform on image_process component."""
|
||||
"""Set up demo platform on image_process component."""
|
||||
config = {
|
||||
ip.DOMAIN: {
|
||||
'platform': 'demo'
|
||||
|
@ -35,7 +35,7 @@ class TestSetupImageProcessing:
|
|||
setup_component(self.hass, ip.DOMAIN, config)
|
||||
|
||||
def test_setup_component_with_service(self):
|
||||
"""Setup demo platform on image_process component test service."""
|
||||
"""Set up demo platform on image_process component test service."""
|
||||
config = {
|
||||
ip.DOMAIN: {
|
||||
'platform': 'demo'
|
||||
|
@ -52,7 +52,7 @@ class TestImageProcessing:
|
|||
"""Test class for image processing."""
|
||||
|
||||
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()
|
||||
|
||||
setup_component(
|
||||
|
@ -113,7 +113,7 @@ class TestImageProcessingAlpr:
|
|||
"""Test class for alpr image processing."""
|
||||
|
||||
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()
|
||||
|
||||
config = {
|
||||
|
@ -149,7 +149,7 @@ class TestImageProcessingAlpr:
|
|||
self.hass.stop()
|
||||
|
||||
def test_alpr_event_single_call(self, aioclient_mock):
|
||||
"""Setup and scan a picture and test plates from event."""
|
||||
"""Set up and scan a picture and test plates from event."""
|
||||
aioclient_mock.get(self.url, content=b'image')
|
||||
|
||||
ip.scan(self.hass, entity_id='image_processing.demo_alpr')
|
||||
|
@ -168,7 +168,7 @@ class TestImageProcessingAlpr:
|
|||
assert event_data[0]['entity_id'] == 'image_processing.demo_alpr'
|
||||
|
||||
def test_alpr_event_double_call(self, aioclient_mock):
|
||||
"""Setup and scan a picture and test plates from event."""
|
||||
"""Set up and scan a picture and test plates from event."""
|
||||
aioclient_mock.get(self.url, content=b'image')
|
||||
|
||||
ip.scan(self.hass, entity_id='image_processing.demo_alpr')
|
||||
|
@ -192,7 +192,7 @@ class TestImageProcessingAlpr:
|
|||
new_callable=PropertyMock(return_value=95))
|
||||
def test_alpr_event_single_call_confidence(self, confidence_mock,
|
||||
aioclient_mock):
|
||||
"""Setup and scan a picture and test plates from event."""
|
||||
"""Set up and scan a picture and test plates from event."""
|
||||
aioclient_mock.get(self.url, content=b'image')
|
||||
|
||||
ip.scan(self.hass, entity_id='image_processing.demo_alpr')
|
||||
|
@ -215,7 +215,7 @@ class TestImageProcessingFace:
|
|||
"""Test class for face image processing."""
|
||||
|
||||
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()
|
||||
|
||||
config = {
|
||||
|
@ -251,7 +251,7 @@ class TestImageProcessingFace:
|
|||
self.hass.stop()
|
||||
|
||||
def test_face_event_call(self, aioclient_mock):
|
||||
"""Setup and scan a picture and test faces from event."""
|
||||
"""Set up and scan a picture and test faces from event."""
|
||||
aioclient_mock.get(self.url, content=b'image')
|
||||
|
||||
ip.scan(self.hass, entity_id='image_processing.demo_face')
|
||||
|
@ -276,7 +276,7 @@ class TestImageProcessingFace:
|
|||
'DemoImageProcessingFace.confidence',
|
||||
new_callable=PropertyMock(return_value=None))
|
||||
def test_face_event_call_no_confidence(self, mock_config, aioclient_mock):
|
||||
"""Setup and scan a picture and test faces from event."""
|
||||
"""Set up and scan a picture and test faces from event."""
|
||||
aioclient_mock.get(self.url, content=b'image')
|
||||
|
||||
ip.scan(self.hass, entity_id='image_processing.demo_face')
|
||||
|
|
|
@ -15,7 +15,7 @@ class TestMicrosoftFaceDetectSetup:
|
|||
"""Test class for image processing."""
|
||||
|
||||
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()
|
||||
|
||||
def teardown_method(self):
|
||||
|
@ -25,7 +25,7 @@ class TestMicrosoftFaceDetectSetup:
|
|||
@patch('homeassistant.components.microsoft_face.'
|
||||
'MicrosoftFace.update_store', return_value=mock_coro())
|
||||
def test_setup_platform(self, store_mock):
|
||||
"""Setup platform with one entity."""
|
||||
"""Set up platform with one entity."""
|
||||
config = {
|
||||
ip.DOMAIN: {
|
||||
'platform': 'microsoft_face_detect',
|
||||
|
@ -51,7 +51,7 @@ class TestMicrosoftFaceDetectSetup:
|
|||
@patch('homeassistant.components.microsoft_face.'
|
||||
'MicrosoftFace.update_store', return_value=mock_coro())
|
||||
def test_setup_platform_name(self, store_mock):
|
||||
"""Setup platform with one entity and set name."""
|
||||
"""Set up platform with one entity and set name."""
|
||||
config = {
|
||||
ip.DOMAIN: {
|
||||
'platform': 'microsoft_face_detect',
|
||||
|
@ -78,7 +78,7 @@ class TestMicrosoftFaceDetect:
|
|||
"""Test class for image processing."""
|
||||
|
||||
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.config = {
|
||||
|
@ -108,7 +108,7 @@ class TestMicrosoftFaceDetect:
|
|||
'MicrosoftFaceDetectEntity.should_poll',
|
||||
new_callable=PropertyMock(return_value=False))
|
||||
def test_ms_detect_process_image(self, poll_mock, aioclient_mock):
|
||||
"""Setup and scan a picture and test plates from event."""
|
||||
"""Set up and scan a picture and test plates from event."""
|
||||
aioclient_mock.get(
|
||||
self.endpoint_url.format("persongroups"),
|
||||
text=load_fixture('microsoft_face_persongroups.json')
|
||||
|
|
|
@ -15,7 +15,7 @@ class TestMicrosoftFaceIdentifySetup:
|
|||
"""Test class for image processing."""
|
||||
|
||||
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()
|
||||
|
||||
def teardown_method(self):
|
||||
|
@ -25,7 +25,7 @@ class TestMicrosoftFaceIdentifySetup:
|
|||
@patch('homeassistant.components.microsoft_face.'
|
||||
'MicrosoftFace.update_store', return_value=mock_coro())
|
||||
def test_setup_platform(self, store_mock):
|
||||
"""Setup platform with one entity."""
|
||||
"""Set up platform with one entity."""
|
||||
config = {
|
||||
ip.DOMAIN: {
|
||||
'platform': 'microsoft_face_identify',
|
||||
|
@ -51,7 +51,7 @@ class TestMicrosoftFaceIdentifySetup:
|
|||
@patch('homeassistant.components.microsoft_face.'
|
||||
'MicrosoftFace.update_store', return_value=mock_coro())
|
||||
def test_setup_platform_name(self, store_mock):
|
||||
"""Setup platform with one entity and set name."""
|
||||
"""Set up platform with one entity and set name."""
|
||||
config = {
|
||||
ip.DOMAIN: {
|
||||
'platform': 'microsoft_face_identify',
|
||||
|
@ -79,7 +79,7 @@ class TestMicrosoftFaceIdentify:
|
|||
"""Test class for image processing."""
|
||||
|
||||
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.config = {
|
||||
|
@ -109,7 +109,7 @@ class TestMicrosoftFaceIdentify:
|
|||
'MicrosoftFaceIdentifyEntity.should_poll',
|
||||
new_callable=PropertyMock(return_value=False))
|
||||
def test_ms_identify_process_image(self, poll_mock, aioclient_mock):
|
||||
"""Setup and scan a picture and test plates from event."""
|
||||
"""Set up and scan a picture and test plates from event."""
|
||||
aioclient_mock.get(
|
||||
self.endpoint_url.format("persongroups"),
|
||||
text=load_fixture('microsoft_face_persongroups.json')
|
||||
|
|
|
@ -16,7 +16,7 @@ class TestOpenAlprCloudSetup:
|
|||
"""Test class for image processing."""
|
||||
|
||||
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()
|
||||
|
||||
def teardown_method(self):
|
||||
|
@ -24,7 +24,7 @@ class TestOpenAlprCloudSetup:
|
|||
self.hass.stop()
|
||||
|
||||
def test_setup_platform(self):
|
||||
"""Setup platform with one entity."""
|
||||
"""Set up platform with one entity."""
|
||||
config = {
|
||||
ip.DOMAIN: {
|
||||
'platform': 'openalpr_cloud',
|
||||
|
@ -45,7 +45,7 @@ class TestOpenAlprCloudSetup:
|
|||
assert self.hass.states.get('image_processing.openalpr_demo_camera')
|
||||
|
||||
def test_setup_platform_name(self):
|
||||
"""Setup platform with one entity and set name."""
|
||||
"""Set up platform with one entity and set name."""
|
||||
config = {
|
||||
ip.DOMAIN: {
|
||||
'platform': 'openalpr_cloud',
|
||||
|
@ -67,7 +67,7 @@ class TestOpenAlprCloudSetup:
|
|||
assert self.hass.states.get('image_processing.test_local')
|
||||
|
||||
def test_setup_platform_without_api_key(self):
|
||||
"""Setup platform with one entity without api_key."""
|
||||
"""Set up platform with one entity without api_key."""
|
||||
config = {
|
||||
ip.DOMAIN: {
|
||||
'platform': 'openalpr_cloud',
|
||||
|
@ -85,7 +85,7 @@ class TestOpenAlprCloudSetup:
|
|||
setup_component(self.hass, ip.DOMAIN, config)
|
||||
|
||||
def test_setup_platform_without_region(self):
|
||||
"""Setup platform with one entity without region."""
|
||||
"""Set up platform with one entity without region."""
|
||||
config = {
|
||||
ip.DOMAIN: {
|
||||
'platform': 'openalpr_cloud',
|
||||
|
@ -107,7 +107,7 @@ class TestOpenAlprCloud:
|
|||
"""Test class for image processing."""
|
||||
|
||||
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()
|
||||
|
||||
config = {
|
||||
|
@ -151,7 +151,7 @@ class TestOpenAlprCloud:
|
|||
self.hass.stop()
|
||||
|
||||
def test_openalpr_process_image(self, aioclient_mock):
|
||||
"""Setup and scan a picture and test plates from event."""
|
||||
"""Set up and scan a picture and test plates from event."""
|
||||
aioclient_mock.post(
|
||||
OPENALPR_API_URL, params=self.params,
|
||||
text=load_fixture('alpr_cloud.json'), status=200
|
||||
|
@ -179,7 +179,7 @@ class TestOpenAlprCloud:
|
|||
'image_processing.test_local'
|
||||
|
||||
def test_openalpr_process_image_api_error(self, aioclient_mock):
|
||||
"""Setup and scan a picture and test api error."""
|
||||
"""Set up and scan a picture and test api error."""
|
||||
aioclient_mock.post(
|
||||
OPENALPR_API_URL, params=self.params,
|
||||
text="{'error': 'error message'}", status=400
|
||||
|
@ -195,7 +195,7 @@ class TestOpenAlprCloud:
|
|||
assert len(self.alpr_events) == 0
|
||||
|
||||
def test_openalpr_process_image_api_timeout(self, aioclient_mock):
|
||||
"""Setup and scan a picture and test api error."""
|
||||
"""Set up and scan a picture and test api error."""
|
||||
aioclient_mock.post(
|
||||
OPENALPR_API_URL, params=self.params,
|
||||
exc=asyncio.TimeoutError()
|
||||
|
|
|
@ -30,7 +30,7 @@ class TestOpenAlprLocalSetup:
|
|||
"""Test class for image processing."""
|
||||
|
||||
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()
|
||||
|
||||
def teardown_method(self):
|
||||
|
@ -38,7 +38,7 @@ class TestOpenAlprLocalSetup:
|
|||
self.hass.stop()
|
||||
|
||||
def test_setup_platform(self):
|
||||
"""Setup platform with one entity."""
|
||||
"""Set up platform with one entity."""
|
||||
config = {
|
||||
ip.DOMAIN: {
|
||||
'platform': 'openalpr_local',
|
||||
|
@ -58,7 +58,7 @@ class TestOpenAlprLocalSetup:
|
|||
assert self.hass.states.get('image_processing.openalpr_demo_camera')
|
||||
|
||||
def test_setup_platform_name(self):
|
||||
"""Setup platform with one entity and set name."""
|
||||
"""Set up platform with one entity and set name."""
|
||||
config = {
|
||||
ip.DOMAIN: {
|
||||
'platform': 'openalpr_local',
|
||||
|
@ -79,7 +79,7 @@ class TestOpenAlprLocalSetup:
|
|||
assert self.hass.states.get('image_processing.test_local')
|
||||
|
||||
def test_setup_platform_without_region(self):
|
||||
"""Setup platform with one entity without region."""
|
||||
"""Set up platform with one entity without region."""
|
||||
config = {
|
||||
ip.DOMAIN: {
|
||||
'platform': 'openalpr_local',
|
||||
|
@ -100,7 +100,7 @@ class TestOpenAlprLocal:
|
|||
"""Test class for image processing."""
|
||||
|
||||
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()
|
||||
|
||||
config = {
|
||||
|
@ -143,7 +143,7 @@ class TestOpenAlprLocal:
|
|||
@patch('asyncio.create_subprocess_exec',
|
||||
return_value=mock_async_subprocess())
|
||||
def test_openalpr_process_image(self, popen_mock, aioclient_mock):
|
||||
"""Setup and scan a picture and test plates from event."""
|
||||
"""Set up and scan a picture and test plates from event."""
|
||||
aioclient_mock.get(self.url, content=b'image')
|
||||
|
||||
ip.scan(self.hass, entity_id='image_processing.test_local')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue