mirror of
https://github.com/esphome/esphome.git
synced 2026-10-13 01:32:49 +00:00
Name a non-list registry system field instead of a TypeError
file["system"] normalized None and str but let an int or dict fall through to the in test, where an int raises TypeError and a dict becomes a key test; both now raise the same Unexpected-response error as the other shape guards.
This commit is contained in:
@@ -442,3 +442,13 @@ def test_registry_download_non_dict_payload_is_named() -> None:
|
||||
pytest.raises(EsphomeError, match="Unexpected package registry response"),
|
||||
):
|
||||
registry.registry_download("pkg", "1.0.0")
|
||||
|
||||
|
||||
def test_registry_download_non_list_system_is_named() -> None:
|
||||
"""A system field that is neither missing, str, nor list is an
|
||||
unexpected payload, not a TypeError from the ``in`` test."""
|
||||
with (
|
||||
_registry_response([{"system": 5, "checksum": {"sha256": "abc"}, "size": 1}]),
|
||||
pytest.raises(EsphomeError, match="Unexpected package registry response"),
|
||||
):
|
||||
registry.registry_download("pkg", "1.0.0")
|
||||
|
||||
Reference in New Issue
Block a user