Inverse parallel updates default check, follow sync "update" method (#71720)

This commit is contained in:
Paulus Schoutsen 2022-05-16 17:10:34 -07:00 committed by GitHub
parent 1a6ccdbf59
commit 3b88c6c012
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 3 deletions

View file

@ -332,6 +332,25 @@ async def test_parallel_updates_sync_platform(hass):
assert entity.parallel_updates._value == 1
async def test_parallel_updates_no_update_method(hass):
"""Test platform parallel_updates default set to 0."""
platform = MockPlatform()
mock_entity_platform(hass, "test_domain.platform", platform)
component = EntityComponent(_LOGGER, DOMAIN, hass)
component._platforms = {}
await component.async_setup({DOMAIN: {"platform": "platform"}})
await hass.async_block_till_done()
handle = list(component._platforms.values())[-1]
entity = MockEntity()
await handle.async_add_entities([entity])
assert entity.parallel_updates is None
async def test_parallel_updates_sync_platform_with_constant(hass):
"""Test sync platform can set parallel_updates limit."""
platform = MockPlatform()