Fix arguments-renamed pylint warning in tests (#119473)
This commit is contained in:
parent
d69e62c096
commit
c70cfbb535
7 changed files with 15 additions and 16 deletions
|
@ -413,10 +413,10 @@ def async_mock_intent(hass, intent_typ):
|
|||
class MockIntentHandler(intent.IntentHandler):
|
||||
intent_type = intent_typ
|
||||
|
||||
async def async_handle(self, intent):
|
||||
async def async_handle(self, intent_obj):
|
||||
"""Handle the intent."""
|
||||
intents.append(intent)
|
||||
return intent.create_response()
|
||||
intents.append(intent_obj)
|
||||
return intent_obj.create_response()
|
||||
|
||||
intent.async_register(hass, MockIntentHandler())
|
||||
|
||||
|
|
|
@ -705,7 +705,7 @@ async def test_get_progress_index(
|
|||
class TestFlow(core_ce.ConfigFlow):
|
||||
VERSION = 5
|
||||
|
||||
async def async_step_hassio(self, info):
|
||||
async def async_step_hassio(self, discovery_info):
|
||||
return await self.async_step_account()
|
||||
|
||||
async def async_step_account(self, user_input=None):
|
||||
|
|
|
@ -29,15 +29,16 @@ async def test_http_handle_intent(
|
|||
|
||||
intent_type = "OrderBeer"
|
||||
|
||||
async def async_handle(self, intent):
|
||||
async def async_handle(self, intent_obj):
|
||||
"""Handle the intent."""
|
||||
assert intent.context.user_id == hass_admin_user.id
|
||||
response = intent.create_response()
|
||||
assert intent_obj.context.user_id == hass_admin_user.id
|
||||
response = intent_obj.create_response()
|
||||
response.async_set_speech(
|
||||
"I've ordered a {}!".format(intent.slots["type"]["value"])
|
||||
"I've ordered a {}!".format(intent_obj.slots["type"]["value"])
|
||||
)
|
||||
response.async_set_card(
|
||||
"Beer ordered", "You chose a {}.".format(intent.slots["type"]["value"])
|
||||
"Beer ordered",
|
||||
"You chose a {}.".format(intent_obj.slots["type"]["value"]),
|
||||
)
|
||||
return response
|
||||
|
||||
|
|
|
@ -97,9 +97,9 @@ class FakeSubscriber(GoogleNestSubscriber):
|
|||
"""Initialize Fake Subscriber."""
|
||||
self._device_manager = DeviceManager()
|
||||
|
||||
def set_update_callback(self, callback: Callable[[EventMessage], Awaitable[None]]):
|
||||
def set_update_callback(self, target: Callable[[EventMessage], Awaitable[None]]):
|
||||
"""Capture the callback set by Home Assistant."""
|
||||
self._device_manager.set_update_callback(callback)
|
||||
self._device_manager.set_update_callback(target)
|
||||
|
||||
async def create_subscription(self):
|
||||
"""Create the subscription."""
|
||||
|
|
|
@ -49,9 +49,7 @@ async def test_register_api(hass: HomeAssistant, llm_context: llm.LLMContext) ->
|
|||
"""Test registering an llm api."""
|
||||
|
||||
class MyAPI(llm.API):
|
||||
async def async_get_api_instance(
|
||||
self, tool_context: llm.ToolInput
|
||||
) -> llm.APIInstance:
|
||||
async def async_get_api_instance(self, _: llm.ToolInput) -> llm.APIInstance:
|
||||
"""Return a list of tools."""
|
||||
return llm.APIInstance(self, "", [], llm_context)
|
||||
|
||||
|
|
|
@ -4879,7 +4879,7 @@ async def test_preview_not_supported(
|
|||
|
||||
VERSION = 1
|
||||
|
||||
async def async_step_user(self, data):
|
||||
async def async_step_user(self, user_input):
|
||||
"""Mock Reauth."""
|
||||
return self.async_show_form(step_id="user_confirm")
|
||||
|
||||
|
|
|
@ -260,7 +260,7 @@ async def test_finish_callback_change_result_type(hass: HomeAssistant) -> None:
|
|||
)
|
||||
|
||||
class FlowManager(data_entry_flow.FlowManager):
|
||||
async def async_create_flow(self, handler_name, *, context, data):
|
||||
async def async_create_flow(self, handler_key, *, context, data):
|
||||
"""Create a test flow."""
|
||||
return TestFlow()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue