Skip to content

Commit

Permalink
Adjust typing of FilesHandlerListEntry (#735)
Browse files Browse the repository at this point in the history
* Adjust typing of FilesHandlerListEntry

* update test
  • Loading branch information
ludeeus authored Nov 5, 2024
1 parent cbb3259 commit ed6b5b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions hass_nabucasa/cloud_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions tests/test_cloud_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down

0 comments on commit ed6b5b2

Please sign in to comment.