Move request sync logic into GoogleConfig (#28227)
* Move request sync logic into GoogleConfig * Return http status code for request_sync same as cloud * agent_user_id is not optional for async_sync_entities now * No need in checking parameter here * Adjust some things for cloud tests * Adjust some more stuff for cloud tests * Drop uneccessary else * Black required change * Let async_schedule_google_sync take agent_user_id * Assert return value on api call * Test old api key method * Update homeassistant/components/google_assistant/helpers.py Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
1 parent
5f1b0fb15c
commit
06231e7ac2
8 files changed
+121
-86
No files matched your search
@@ -85,14 +85,18 @@ def mock_cognito():
|
||||
yield mock_cog()
|
||||
|
||||
|
||||
async def test_google_actions_sync(mock_cognito, cloud_client, aioclient_mock):
|
||||
async def test_google_actions_sync(
|
||||
mock_cognito, mock_cloud_login, cloud_client, aioclient_mock
|
||||
):
|
||||
"""Test syncing Google Actions."""
|
||||
aioclient_mock.post(GOOGLE_ACTIONS_SYNC_URL)
|
||||
req = await cloud_client.post("/api/cloud/google_actions/sync")
|
||||
assert req.status == 200
|
||||
|
||||
|
||||
async def test_google_actions_sync_fails(mock_cognito, cloud_client, aioclient_mock):
|
||||
async def test_google_actions_sync_fails(
|
||||
mock_cognito, mock_cloud_login, cloud_client, aioclient_mock
|
||||
):
|
||||
"""Test syncing Google Actions gone bad."""
|
||||
aioclient_mock.post(GOOGLE_ACTIONS_SYNC_URL, status=403)
|
||||
req = await cloud_client.post("/api/cloud/google_actions/sync")
|
||||
|
||||
Reference in new issue
Block a user