refactoring

This commit is contained in:
Stefan Allius
2024-09-24 21:12:51 +02:00
parent 89c2c11ed9
commit d5c369e5fe
23 changed files with 1257 additions and 942 deletions

View File

@@ -18,7 +18,7 @@ pytest_plugins = ('pytest_asyncio',)
@pytest.fixture(scope="module", autouse=True)
def module_init():
def new_init(cls, cb_mqtt_is_up):
cb_mqtt_is_up()
pass # empty test methos
Singleton._instances.clear()
with patch.object(Mqtt, '__init__', new_init):
@@ -69,6 +69,7 @@ async def test_inverter_cb(config_conn):
assert 'homeassistant/' == Inverter.discovery_prfx
assert 'tsun/' == Inverter.entity_prfx
assert 'test_1/' == Inverter.proxy_node_id
await Inverter._cb_mqtt_is_up()
spy.assert_called_once()
@pytest.mark.asyncio