From ed6b5b2e3f78a20f37ded55254ac2948dca33931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Tue, 5 Nov 2024 08:49:24 +0100 Subject: [PATCH] Adjust typing of FilesHandlerListEntry (#735) * Adjust typing of FilesHandlerListEntry * update test --- hass_nabucasa/cloud_api.py | 8 ++++---- tests/test_cloud_api.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hass_nabucasa/cloud_api.py b/hass_nabucasa/cloud_api.py index de0dff2e7..cf2be0e8b 100644 --- a/hass_nabucasa/cloud_api.py +++ b/hass_nabucasa/cloud_api.py @@ -46,10 +46,10 @@ class FilesHandlerUploadDetails(_FilesHandlerUrlResponse): class FilesHandlerListEntry(TypedDict): """List entry for files handlers.""" - key: str - size: int - last_modified: str - tags: dict[str, Any] + Key: str + Size: int + LastModified: str + Metadata: dict[str, str] def _do_log_response(resp: ClientResponse, content: str = "") -> None: diff --git a/tests/test_cloud_api.py b/tests/test_cloud_api.py index 130a170d7..aece0cde1 100644 --- a/tests/test_cloud_api.py +++ b/tests/test_cloud_api.py @@ -258,7 +258,7 @@ async def test_async_files_list( """Test the async_files_list function.""" aioclient_mock.get( "https://example.com/files/list", - json=[{"key": "test.txt", "last_modified": "2021-01-01T00:00:00Z", "size": 2}], + json=[{"Key": "test.txt", "LastModified": "2021-01-01T00:00:00Z", "Size": 2}], ) auth_cloud_mock.id_token = "mock-id-token" auth_cloud_mock.servicehandlers_server = "example.com" @@ -276,9 +276,9 @@ async def test_async_files_list( assert details == [ { - "key": "test.txt", - "last_modified": "2021-01-01T00:00:00Z", - "size": 2, + "Key": "test.txt", + "LastModified": "2021-01-01T00:00:00Z", + "Size": 2, }, ] assert "Fetched https://example.com/files/list (200)" in caplog.text