Migrate Glances to new entity naming style (#76651)

* Migrate Glances to new entity naming style

* minor fixes
This commit is contained in:
Rami Mosleh 2022-08-12 10:50:27 +03:00 committed by GitHub
parent 828b97f460
commit 86b968bf79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 240 additions and 232 deletions

View file

@ -2,6 +2,7 @@
from unittest.mock import patch
from glances_api import exceptions
import pytest
from homeassistant import config_entries, data_entry_flow
from homeassistant.components import glances
@ -18,7 +19,6 @@ VERSION = 3
SCAN_INTERVAL = 10
DEMO_USER_INPUT = {
"name": NAME,
"host": HOST,
"username": USERNAME,
"password": PASSWORD,
@ -29,6 +29,13 @@ DEMO_USER_INPUT = {
}
@pytest.fixture(autouse=True)
def glances_setup_fixture():
"""Mock transmission entry setup."""
with patch("homeassistant.components.glances.async_setup_entry", return_value=True):
yield
async def test_form(hass):
"""Test config entry configured successfully."""
@ -45,7 +52,7 @@ async def test_form(hass):
)
assert result["type"] == "create_entry"
assert result["title"] == NAME
assert result["title"] == HOST
assert result["data"] == DEMO_USER_INPUT