1
mirror of https://github.com/home-assistant/core synced 2024-09-09 12:51:22 +02:00
ha-core/tests/test_util
Ziv 302e631984
Ability to mock long poll requests + refactor qwikswitch unit… (#33804)
* added the ability to mock a "long poll" get request by setting up the
waiting request and feeding responses to it
with this, refactored the qwikswitch test so it doesn't use global variables
and is more understandable and maintainable

* added import asyncio from merge

* added assert that first call with long_poll has empty content

* passing json instead of the binary string

* use json instead of text in mock requests

* refactored to use a proxy

* return the proxy also for the http methods other than get

* refactored so any side_effect can be used and created the long_poll side effect

* simplified by using kwargs
needed to move the json->text->content logic from mocker to mockrequest

* no need to explicitly define method and url
2020-04-10 14:57:39 -07:00
..
__init__.py Add config flow for Hue (#12830) 2018-03-03 21:28:04 -08:00
aiohttp.py Ability to mock long poll requests + refactor qwikswitch unit… (#33804) 2020-04-10 14:57:39 -07:00
test_aiohttp.py Sort imports according to PEP8 for 'tests' (#29791) 2019-12-09 16:52:24 +01:00