1ceee2d6c5904216c974c914bf37bbf3ee689ef0,tests/components/test_mqtt.py,TestMQTTCallbacks,test_mqtt_subscribes_topics_on_connect,#TestMQTTCallbacks#,180
Before Change
"home/sensor": 2,
"still/pending": None
}
mqttc = mock.MagicMock()
mqtt._mqtt_on_connect(mqttc, {"topics": prev_topics}, 0, 0)
self.assertFalse(mqttc.disconnect.called)
expected = [(topic, qos) for topic, qos in prev_topics.items()
After Change
def test_mqtt_subscribes_topics_on_connect(self):
from collections import OrderedDict
prev_topics = OrderedDict()
prev_topics["topic/test"] = 1,
prev_topics["home/sensor"] = 2,
prev_topics["still/pending"] = None
mqtt.MQTT_CLIENT.topics = prev_topics
mqtt.MQTT_CLIENT.progress = {1: "still/pending"}
// Return values for subscribe calls (rc, mid)
mqtt.MQTT_CLIENT._mqttc.subscribe.side_effect = ((0, 2), (0, 3))
mqtt.MQTT_CLIENT._mqtt_on_connect(None, None, 0, 0)
self.assertFalse(mqtt.MQTT_CLIENT._mqttc.disconnect.called)
expected = [(topic, qos) for topic, qos in prev_topics.items()
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 16
Instances
Project Name: home-assistant/home-assistant
Commit Name: 1ceee2d6c5904216c974c914bf37bbf3ee689ef0
Time: 2016-01-19
Author: paulus@paulusschoutsen.nl
File Name: tests/components/test_mqtt.py
Class Name: TestMQTTCallbacks
Method Name: test_mqtt_subscribes_topics_on_connect
Project Name: home-assistant/home-assistant
Commit Name: 1ceee2d6c5904216c974c914bf37bbf3ee689ef0
Time: 2016-01-19
Author: paulus@paulusschoutsen.nl
File Name: tests/components/test_mqtt.py
Class Name: TestMQTTCallbacks
Method Name: test_mqtt_subscribes_topics_on_connect
Project Name: home-assistant/home-assistant
Commit Name: 8fbb5858743dc4f356bdff3f0126899aad9c3aa8
Time: 2016-01-17
Author: paulus@paulusschoutsen.nl
File Name: tests/components/test_mqtt.py
Class Name: TestMQTTCallbacks
Method Name: test_mqtt_subscribes_topics_on_connect
Project Name: home-assistant/home-assistant
Commit Name: 1ceee2d6c5904216c974c914bf37bbf3ee689ef0
Time: 2016-01-19
Author: paulus@paulusschoutsen.nl
File Name: tests/components/test_mqtt.py
Class Name: TestMQTTCallbacks
Method Name: test_mqtt_disconnect_tries_reconnect
Project Name: home-assistant/home-assistant
Commit Name: 8fbb5858743dc4f356bdff3f0126899aad9c3aa8
Time: 2016-01-17
Author: paulus@paulusschoutsen.nl
File Name: tests/components/test_mqtt.py
Class Name: TestMQTTCallbacks
Method Name: test_mqtt_disconnect_tries_reconnect