mirror of
https://github.com/home-assistant/core.git
synced 2025-08-23 22:41:39 +02:00
remove unneeded ticks
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
"""Tests for init module."""
|
"""Tests for init module."""
|
||||||
|
|
||||||
from datetime import timedelta
|
|
||||||
import http
|
import http
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
@@ -16,9 +15,6 @@ import pytest
|
|||||||
from syrupy.assertion import SnapshotAssertion
|
from syrupy.assertion import SnapshotAssertion
|
||||||
|
|
||||||
from homeassistant.components.husqvarna_automower.const import DOMAIN, OAUTH2_TOKEN
|
from homeassistant.components.husqvarna_automower.const import DOMAIN, OAUTH2_TOKEN
|
||||||
from homeassistant.components.husqvarna_automower.coordinator import (
|
|
||||||
MAX_WS_RECONNECT_TIME,
|
|
||||||
)
|
|
||||||
from homeassistant.config_entries import ConfigEntryState
|
from homeassistant.config_entries import ConfigEntryState
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import device_registry as dr
|
from homeassistant.helpers import device_registry as dr
|
||||||
@@ -26,7 +22,7 @@ from homeassistant.helpers import device_registry as dr
|
|||||||
from . import setup_integration
|
from . import setup_integration
|
||||||
from .const import TEST_MOWER_ID
|
from .const import TEST_MOWER_ID
|
||||||
|
|
||||||
from tests.common import MockConfigEntry, async_fire_time_changed
|
from tests.common import MockConfigEntry
|
||||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
from tests.test_util.aiohttp import AiohttpClientMocker
|
||||||
|
|
||||||
|
|
||||||
@@ -159,8 +155,6 @@ async def test_websocket_not_available(
|
|||||||
|
|
||||||
# Simulate a successful connection
|
# Simulate a successful connection
|
||||||
mock_automower_client.auth.websocket_connect.side_effect = None
|
mock_automower_client.auth.websocket_connect.side_effect = None
|
||||||
freezer.tick(timedelta(seconds=MAX_WS_RECONNECT_TIME))
|
|
||||||
async_fire_time_changed(hass)
|
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
assert mock_automower_client.start_listening.call_count == 1
|
assert mock_automower_client.start_listening.call_count == 1
|
||||||
|
|
||||||
@@ -168,8 +162,6 @@ async def test_websocket_not_available(
|
|||||||
mock_automower_client.auth.websocket_connect.side_effect = (
|
mock_automower_client.auth.websocket_connect.side_effect = (
|
||||||
HusqvarnaWSServerHandshakeError("Boom")
|
HusqvarnaWSServerHandshakeError("Boom")
|
||||||
)
|
)
|
||||||
freezer.tick(timedelta(seconds=0))
|
|
||||||
async_fire_time_changed(hass)
|
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
assert (
|
assert (
|
||||||
mock_automower_client.auth.websocket_connect.call_count
|
mock_automower_client.auth.websocket_connect.call_count
|
||||||
|
Reference in New Issue
Block a user