Fix failing unifiprotect unit tests (#77575)

* Patch `final` pydantic fields during unit test

* Use a fixed date with 31 days to ensure unit tests pass every month
This commit is contained in:
puddly 2022-08-30 22:17:03 -04:00 committed by GitHub
parent 0c35166a7b
commit 5b3f4ec471
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 45 additions and 45 deletions

View file

@ -214,7 +214,7 @@ async def test_lock_do_lock(
await init_entry(hass, ufp, [doorlock, unadopted_doorlock])
assert_entity_counts(hass, Platform.LOCK, 1, 1)
doorlock.__fields__["close_lock"] = Mock()
doorlock.__fields__["close_lock"] = Mock(final=False)
doorlock.close_lock = AsyncMock()
await hass.services.async_call(
@ -249,7 +249,7 @@ async def test_lock_do_unlock(
ufp.ws_msg(mock_msg)
await hass.async_block_till_done()
new_lock.__fields__["open_lock"] = Mock()
new_lock.__fields__["open_lock"] = Mock(final=False)
new_lock.open_lock = AsyncMock()
await hass.services.async_call(