1
1
"""Test ocpp setup process."""
2
2
# from homeassistant.exceptions import ConfigEntryNotReady
3
3
# import pytest
4
+ from typing import AsyncGenerator
5
+
6
+ from homeassistant .core import HomeAssistant
4
7
from pytest_homeassistant_custom_component .common import MockConfigEntry
5
8
6
9
from custom_components .ocpp import (
19
22
# Home Assistant using the pytest_homeassistant_custom_component plugin.
20
23
# Assertions allow you to verify that the return value of whatever is on the left
21
24
# side of the assertion matches with the right side.
22
- async def test_setup_unload_and_reload_entry (hass , bypass_get_data ):
25
+ async def test_setup_unload_and_reload_entry (
26
+ hass : AsyncGenerator [HomeAssistant , None ], bypass_get_data : None
27
+ ):
23
28
"""Test entry setup and unload."""
24
29
# Create a mock entry so we don't have to go through config flow
25
30
config_entry = MockConfigEntry (
@@ -35,12 +40,12 @@ async def test_setup_unload_and_reload_entry(hass, bypass_get_data):
35
40
await hass .async_block_till_done ()
36
41
37
42
assert DOMAIN in hass .data and config_entry .entry_id in hass .data [DOMAIN ]
38
- assert type (hass .data [DOMAIN ][config_entry .entry_id ]) == CentralSystem
43
+ assert type (hass .data [DOMAIN ][config_entry .entry_id ]) is CentralSystem
39
44
40
45
# Reload the entry and assert that the data from above is still there
41
46
assert await async_reload_entry (hass , config_entry ) is None
42
47
assert DOMAIN in hass .data and config_entry .entry_id in hass .data [DOMAIN ]
43
- assert type (hass .data [DOMAIN ][config_entry .entry_id ]) == CentralSystem
48
+ assert type (hass .data [DOMAIN ][config_entry .entry_id ]) is CentralSystem
44
49
45
50
# Unload the entry and verify that the data has been removed
46
51
unloaded = await async_unload_entry (hass , config_entry )
0 commit comments