Fix google sync (#30524)

This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2020-01-06 22:00:39 +01:00
1 parent a84741392b
commit 05374d7c85
7 files changed
+39 -7

No files matched your search

+7 -3
View File
@@ -103,13 +103,17 @@ async def test_handler_google_actions(hass):
reqid = "5711642932632160983"
data = {"requestId": reqid, "inputs": [{"intent": "action.devices.SYNC"}]}
config = await cloud.client.get_google_config()
resp = await cloud.client.async_google_message(data)
with patch(
"hass_nabucasa.Cloud._decode_claims",
return_value={"cognito:username": "myUserName"},
):
await cloud.client.get_google_config()
resp = await cloud.client.async_google_message(data)
assert resp["requestId"] == reqid
payload = resp["payload"]
assert payload["agentUserId"] == config.cloud_user
assert payload["agentUserId"] == "myUserName"
devices = payload["devices"]
assert len(devices) == 1