Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ollo69 committed Apr 27, 2024
1 parent 0e8bc1e commit 2cd3177
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion custom_components/smartthinq_sensors/wideq/core_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ def _get_session(self) -> aiohttp.ClientSession:
def _get_client_id(self, user_number: str | None = None) -> str:
"""Generate a new clent ID or return existing."""
if self._client_id is not None:
_LOGGER.info("Client ID: %s", self._client_id)
return self._client_id
if user_number is None:
return None
Expand Down
5 changes: 5 additions & 0 deletions tests/test_config_flow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test the SmartThinQ sensors config flow."""

from unittest.mock import AsyncMock, patch

import pytest
Expand All @@ -7,6 +8,7 @@
from homeassistant import config_entries, data_entry_flow
from homeassistant.const import (
CONF_BASE,
CONF_CLIENT_ID,
CONF_PASSWORD,
CONF_REGION,
CONF_TOKEN,
Expand All @@ -28,6 +30,7 @@
TEST_USER = "test-email@test-domain.com"
TEST_TOKEN = "test-token"
TEST_URL = "test-url"
TEST_CLIENT_ID = "abcde"

CONFIG_DATA = {
CONF_USERNAME: TEST_USER,
Expand All @@ -41,6 +44,7 @@
CONF_LANGUAGE: "en-US",
CONF_USE_API_V2: True,
CONF_TOKEN: TEST_TOKEN,
CONF_CLIENT_ID: TEST_CLIENT_ID,
CONF_OAUTH2_URL: TEST_URL,
}

Expand All @@ -51,6 +55,7 @@ class MockClient:
def __init__(self, has_devices=True):
"""Initialize a fake client to test config flow."""
self.has_devices = has_devices
self.client_id = TEST_CLIENT_ID

async def close(self):
"""Fake close method."""
Expand Down

0 comments on commit 2cd3177

Please sign in to comment.