1
mirror of https://github.com/home-assistant/core synced 2024-09-18 19:55:20 +02:00
ha-core/tests
Otto Winter b1c0cabe6c Fix MQTT retained message not being re-dispatched (#12004)
* Fix MQTT retained message not being re-dispatched

* Fix tests

* Use paho-mqtt for retained messages

* Improve code style

* Store list of subscribers

* Fix lint error

* Adhere to Home Assistant's logging standard

"Try to avoid brackets and additional quotes around the output to make it easier for users to parse the log."
 - https://home-assistant.io/developers/development_guidelines/

* Add reconnect tests

* Fix lint error

* Introduce Subscription

Tests still need to be updated

* Use namedtuple for MQTT messages

... And fix issues

Accessing the config manually at runtime isn't ideal

* Fix MQTT __init__.py tests

* Updated usage of Mocks
* Moved tests that were testing subscriptions out of the MQTTComponent test, because of how mock.patch was used
* Adjusted the remaining tests for the MQTT clients new behavior - e.g. self.progress was removed
* Updated the async_fire_mqtt_message helper

*  Update MQTT tests

* Re-introduce the MQTT subscriptions through the dispatcher for tests - quite ugly though...  🚧
* Update fixtures to use our new MQTT mock 🎨

* 📝 Update base code according to comments

* 🔨 Adjust MQTT test base

* 🔨 Update other MQTT tests

* 🍎 Fix carriage return in source files

Apparently test_mqtt_json.py and test_mqtt_template.py were written on Windows. In order to not mess up the diff, I'll just redo the carriage return.

* 🎨 Remove unused import

* 📝 Remove fire_mqtt_client_message

* 🐛 Fix using python 3.6 method

What's very interesting is that 3.4 didn't fail on travis...

* 🐛 Fix using assert directly
2018-02-11 09:17:58 -08:00
..
components Fix MQTT retained message not being re-dispatched (#12004) 2018-02-11 09:17:58 -08:00
fixtures Add Melissa (HVAC/climate) component (#11503) 2018-02-03 03:17:01 +01:00
helpers Allow overriding name via entity registry (#12292) 2018-02-11 09:16:01 -08:00
mock Tests for zwave setup features (#7570) 2017-05-12 20:27:44 -07:00
resources Revised package util tests 2016-01-30 14:08:32 -05:00
scripts Attempt fixing flakiness of check config test (#12283) 2018-02-11 09:00:02 -08:00
test_util Flake8 bugbear fixes (#12072) 2018-01-30 14:44:05 -08:00
testing_config Add Kira component to sensor and remote platforms (#7479) 2017-05-12 21:12:47 -07:00
util Remove asyncio.test_utils to fix tests in Docker/Python 3.7 (#12102) 2018-02-02 14:59:05 +00:00
__init__.py async HTTP component (#3914) 2016-10-23 23:48:01 -07:00
common.py Fix MQTT retained message not being re-dispatched (#12004) 2018-02-11 09:17:58 -08:00
conftest.py Fix MQTT retained message not being re-dispatched (#12004) 2018-02-11 09:17:58 -08:00
test_bootstrap.py Spelling fixes (#11940) 2018-01-27 11:58:27 -08:00
test_config.py Entity layer cleanup (#12237) 2018-02-08 12:16:51 +01:00
test_core.py Flake8 bugbear fixes (#12072) 2018-01-30 14:44:05 -08:00
test_loader.py RFC: Use bind_hass for helpers (#9745) 2017-10-08 08:17:54 -07:00
test_main.py Migrate core from threads to async awesomeness (#3248) 2016-09-12 19:16:14 -07:00
test_remote.py Spelling fixes (#11940) 2018-01-27 11:58:27 -08:00
test_requirements.py Extract requirements (#12051) 2018-01-30 12:30:47 +01:00
test_setup.py Extract requirements (#12051) 2018-01-30 12:30:47 +01:00