Don't allow in-memory SQLite database (#69616)

This commit is contained in:
Erik Montnemery
2022-04-08 00:43:09 +02:00
committed by GitHub
parent fab1f29a29
commit 949b0e1b65
8 changed files with 77 additions and 40 deletions

View File

@@ -1394,3 +1394,11 @@ async def test_database_lock_without_instance(hass):
assert await instance.lock_database()
finally:
assert instance.unlock_database()
async def test_in_memory_database(hass, caplog):
"""Test connecting to an in-memory recorder is not allowed."""
assert not await async_setup_component(
hass, recorder.DOMAIN, {recorder.DOMAIN: {recorder.CONF_DB_URL: "sqlite://"}}
)
assert "In-memory SQLite database is not supported" in caplog.text