1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Raise if trying to store mocks in storage (#63622)

This commit is contained in:
Paulus Schoutsen
2022-01-09 21:20:21 -08:00
committed by GitHub
parent d8ba90fb8a
commit 689504af86
2 changed files with 19 additions and 2 deletions

View File

@@ -73,7 +73,9 @@ async def test_custom_encoder(hass):
return "9"
store = storage.Store(hass, MOCK_VERSION, MOCK_KEY, encoder=JSONEncoder)
await store.async_save(Mock())
with pytest.raises(ValueError):
await store.async_save(Mock())
await store.async_save(object())
data = await store.async_load()
assert data == "9"