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:
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user