Remove incorrect use of Mock.assert_has_calls from recorder tests (#122439)

* Remove incorrect use of Mock.assert_has_calls from recorder tests

* Fix test
pull/122466/head
Erik Montnemery 2024-07-23 09:39:27 +02:00 committed by GitHub
parent cd48278671
commit 108dc3795e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 11 deletions

View File

@ -83,17 +83,15 @@ async def test_schema_update_calls(
instance = recorder.get_instance(hass)
engine = instance.engine
session_maker = instance.get_session
update.assert_has_calls(
[
call(instance, hass, engine, session_maker, version + 1, 0)
for version in range(db_schema.SCHEMA_VERSION)
]
)
migrate_schema.assert_has_calls(
[
call(instance, hass, engine, session_maker, ANY, db_schema.SCHEMA_VERSION),
]
)
assert update.mock_calls == [
call(instance, hass, engine, session_maker, version + 1, 0)
for version in range(db_schema.SCHEMA_VERSION)
]
status = migration.SchemaValidationStatus(0, True, set(), 0)
assert migrate_schema.mock_calls == [
call(instance, hass, engine, session_maker, status, 0),
call(instance, hass, engine, session_maker, status, db_schema.SCHEMA_VERSION),
]
async def test_migration_in_progress(