mirror of
https://github.com/home-assistant/core.git
synced 2025-11-18 07:20:13 +00:00
committed by
GitHub
parent
3d580259e1
commit
0fdf037ba0
@@ -155,7 +155,7 @@ raise Exception('boom')
|
||||
task = hass.async_add_executor_job(execute, hass, "test.py", source, {}, True)
|
||||
await hass.async_block_till_done(wait_background_tasks=True)
|
||||
|
||||
assert type(task.exception()) == HomeAssistantError
|
||||
assert type(task.exception()) is HomeAssistantError
|
||||
assert "Error executing script (Exception): boom" in str(task.exception())
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ hass.async_stop()
|
||||
task = hass.async_add_executor_job(execute, hass, "test.py", source, {}, True)
|
||||
await hass.async_block_till_done(wait_background_tasks=True)
|
||||
|
||||
assert type(task.exception()) == ServiceValidationError
|
||||
assert type(task.exception()) is ServiceValidationError
|
||||
assert "Not allowed to access async methods" in str(task.exception())
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@ async def test_accessing_forbidden_methods_with_response(hass: HomeAssistant) ->
|
||||
task = hass.async_add_executor_job(execute, hass, "test.py", source, {}, True)
|
||||
await hass.async_block_till_done(wait_background_tasks=True)
|
||||
|
||||
assert type(task.exception()) == ServiceValidationError
|
||||
assert type(task.exception()) is ServiceValidationError
|
||||
assert f"Not allowed to access {name}" in str(task.exception())
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user