core/tests/components/switch
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
..
__init__.py Fix PEP257 issues 2016-03-09 10:25:50 +01:00
test_command_line.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_flux.py Set flux default stop time to dusk (#12062) 2018-01-31 12:00:47 +01:00
test_init.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_litejet.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_mfi.py Revise power and energy units and property names. (#6212) 2017-03-19 22:02:11 +01:00
test_mochad.py Reconnect before mochad switch send command (#11296) 2018-01-08 08:32:24 +01:00
test_mqtt.py Fix MQTT retained message not being re-dispatched (#12004) 2018-02-11 09:17:58 -08:00
test_rest.py Add HTTP Basic auth to RESTful Switch (#9162) 2017-09-09 10:20:48 -07:00
test_rflink.py Add test cases and fix for device_defaults fire_event option. (#9567) 2017-09-24 15:47:59 -07:00
test_rfxtrx.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_template.py Add entity_picture_template options to Template Cover, Template Light, Template Sensor, and Template Switch (#9854) 2017-10-30 09:28:37 -07:00
test_vultr.py Fix vultr tests (#11477) 2018-01-05 16:34:03 -08:00
test_wake_on_lan.py Fix source code using Windows newline (#12248) 2018-02-09 08:11:47 +01:00
test_zwave.py Zwave: Apply refresh_node workaround on 1st instance only (#7579) 2017-05-21 17:33:42 +03:00