mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +00:00
Add unittest for cleanup not validate ssl stuff. (#5643)
This commit is contained in:
parent
f1d1f7d032
commit
ca558f6485
@ -100,6 +100,25 @@ class TestHelpersAiohttpClient(unittest.TestCase):
|
|||||||
assert self.hass.data[client.DATA_CLIENTSESSION].closed
|
assert self.hass.data[client.DATA_CLIENTSESSION].closed
|
||||||
assert self.hass.data[client.DATA_CONNECTOR].closed
|
assert self.hass.data[client.DATA_CONNECTOR].closed
|
||||||
|
|
||||||
|
def test_get_clientsession_cleanup_without_ssl(self):
|
||||||
|
"""Test init clientsession with ssl."""
|
||||||
|
run_callback_threadsafe(self.hass.loop, client.async_get_clientsession,
|
||||||
|
self.hass, False).result()
|
||||||
|
|
||||||
|
assert isinstance(
|
||||||
|
self.hass.data[client.DATA_CLIENTSESSION_NOTVERIFY],
|
||||||
|
aiohttp.ClientSession)
|
||||||
|
assert isinstance(
|
||||||
|
self.hass.data[client.DATA_CONNECTOR_NOTVERIFY],
|
||||||
|
aiohttp.TCPConnector)
|
||||||
|
|
||||||
|
run_coroutine_threadsafe(
|
||||||
|
client.async_cleanup_websession(self.hass), self.hass.loop
|
||||||
|
).result()
|
||||||
|
|
||||||
|
assert self.hass.data[client.DATA_CLIENTSESSION_NOTVERIFY].closed
|
||||||
|
assert self.hass.data[client.DATA_CONNECTOR_NOTVERIFY].closed
|
||||||
|
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def test_fetching_url(aioclient_mock, hass, test_client):
|
def test_fetching_url(aioclient_mock, hass, test_client):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user