mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Fix flaky YesssSMS tests on debug messages (#28506)
This commit is contained in:
parent
5fd9b474dc
commit
0768ae2dc8
@ -2,6 +2,7 @@
|
|||||||
import unittest
|
import unittest
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
|
import logging
|
||||||
import pytest
|
import pytest
|
||||||
import requests_mock
|
import requests_mock
|
||||||
|
|
||||||
@ -101,6 +102,7 @@ async def test_false_login_data_error(hass, caplog, valid_settings, invalid_logi
|
|||||||
|
|
||||||
async def test_init_success(hass, caplog, valid_settings, valid_login_data):
|
async def test_init_success(hass, caplog, valid_settings, valid_login_data):
|
||||||
"""Test for successful init of yessssms."""
|
"""Test for successful init of yessssms."""
|
||||||
|
caplog.set_level(logging.DEBUG)
|
||||||
await valid_settings
|
await valid_settings
|
||||||
assert hass.services.has_service("notify", "sms")
|
assert hass.services.has_service("notify", "sms")
|
||||||
messages = []
|
messages = []
|
||||||
@ -119,6 +121,7 @@ async def test_init_success(hass, caplog, valid_settings, valid_login_data):
|
|||||||
|
|
||||||
async def test_connection_error_on_init(hass, caplog, valid_settings, connection_error):
|
async def test_connection_error_on_init(hass, caplog, valid_settings, connection_error):
|
||||||
"""Test for connection error on init."""
|
"""Test for connection error on init."""
|
||||||
|
caplog.set_level(logging.DEBUG)
|
||||||
await valid_settings
|
await valid_settings
|
||||||
assert hass.services.has_service("notify", "sms")
|
assert hass.services.has_service("notify", "sms")
|
||||||
for record in caplog.records:
|
for record in caplog.records:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user