Convert config.components to a set (#5824)
This commit is contained in:
parent
f3b9fa2f41
commit
c54517de90
44 changed files with 118 additions and 104 deletions
|
@ -30,7 +30,7 @@ class TestAlarmControlPanelMQTT(unittest.TestCase):
|
|||
|
||||
def test_fail_setup_without_state_topic(self):
|
||||
"""Test for failing with no state topic."""
|
||||
self.hass.config.components = ['mqtt']
|
||||
self.hass.config.components = set(['mqtt'])
|
||||
with assert_setup_component(0) as config:
|
||||
assert setup_component(self.hass, alarm_control_panel.DOMAIN, {
|
||||
alarm_control_panel.DOMAIN: {
|
||||
|
@ -42,7 +42,7 @@ class TestAlarmControlPanelMQTT(unittest.TestCase):
|
|||
|
||||
def test_fail_setup_without_command_topic(self):
|
||||
"""Test failing with no command topic."""
|
||||
self.hass.config.components = ['mqtt']
|
||||
self.hass.config.components = set(['mqtt'])
|
||||
with assert_setup_component(0):
|
||||
assert setup_component(self.hass, alarm_control_panel.DOMAIN, {
|
||||
alarm_control_panel.DOMAIN: {
|
||||
|
@ -53,7 +53,7 @@ class TestAlarmControlPanelMQTT(unittest.TestCase):
|
|||
|
||||
def test_update_state_via_state_topic(self):
|
||||
"""Test updating with via state topic."""
|
||||
self.hass.config.components = ['mqtt']
|
||||
self.hass.config.components = set(['mqtt'])
|
||||
assert setup_component(self.hass, alarm_control_panel.DOMAIN, {
|
||||
alarm_control_panel.DOMAIN: {
|
||||
'platform': 'mqtt',
|
||||
|
@ -77,7 +77,7 @@ class TestAlarmControlPanelMQTT(unittest.TestCase):
|
|||
|
||||
def test_ignore_update_state_if_unknown_via_state_topic(self):
|
||||
"""Test ignoring updates via state topic."""
|
||||
self.hass.config.components = ['mqtt']
|
||||
self.hass.config.components = set(['mqtt'])
|
||||
assert setup_component(self.hass, alarm_control_panel.DOMAIN, {
|
||||
alarm_control_panel.DOMAIN: {
|
||||
'platform': 'mqtt',
|
||||
|
@ -98,7 +98,7 @@ class TestAlarmControlPanelMQTT(unittest.TestCase):
|
|||
|
||||
def test_arm_home_publishes_mqtt(self):
|
||||
"""Test publishing of MQTT messages while armed."""
|
||||
self.hass.config.components = ['mqtt']
|
||||
self.hass.config.components = set(['mqtt'])
|
||||
assert setup_component(self.hass, alarm_control_panel.DOMAIN, {
|
||||
alarm_control_panel.DOMAIN: {
|
||||
'platform': 'mqtt',
|
||||
|
@ -115,7 +115,7 @@ class TestAlarmControlPanelMQTT(unittest.TestCase):
|
|||
|
||||
def test_arm_home_not_publishes_mqtt_with_invalid_code(self):
|
||||
"""Test not publishing of MQTT messages with invalid code."""
|
||||
self.hass.config.components = ['mqtt']
|
||||
self.hass.config.components = set(['mqtt'])
|
||||
assert setup_component(self.hass, alarm_control_panel.DOMAIN, {
|
||||
alarm_control_panel.DOMAIN: {
|
||||
'platform': 'mqtt',
|
||||
|
@ -133,7 +133,7 @@ class TestAlarmControlPanelMQTT(unittest.TestCase):
|
|||
|
||||
def test_arm_away_publishes_mqtt(self):
|
||||
"""Test publishing of MQTT messages while armed."""
|
||||
self.hass.config.components = ['mqtt']
|
||||
self.hass.config.components = set(['mqtt'])
|
||||
assert setup_component(self.hass, alarm_control_panel.DOMAIN, {
|
||||
alarm_control_panel.DOMAIN: {
|
||||
'platform': 'mqtt',
|
||||
|
@ -150,7 +150,7 @@ class TestAlarmControlPanelMQTT(unittest.TestCase):
|
|||
|
||||
def test_arm_away_not_publishes_mqtt_with_invalid_code(self):
|
||||
"""Test not publishing of MQTT messages with invalid code."""
|
||||
self.hass.config.components = ['mqtt']
|
||||
self.hass.config.components = set(['mqtt'])
|
||||
assert setup_component(self.hass, alarm_control_panel.DOMAIN, {
|
||||
alarm_control_panel.DOMAIN: {
|
||||
'platform': 'mqtt',
|
||||
|
@ -168,7 +168,7 @@ class TestAlarmControlPanelMQTT(unittest.TestCase):
|
|||
|
||||
def test_disarm_publishes_mqtt(self):
|
||||
"""Test publishing of MQTT messages while disarmed."""
|
||||
self.hass.config.components = ['mqtt']
|
||||
self.hass.config.components = set(['mqtt'])
|
||||
assert setup_component(self.hass, alarm_control_panel.DOMAIN, {
|
||||
alarm_control_panel.DOMAIN: {
|
||||
'platform': 'mqtt',
|
||||
|
@ -185,7 +185,7 @@ class TestAlarmControlPanelMQTT(unittest.TestCase):
|
|||
|
||||
def test_disarm_not_publishes_mqtt_with_invalid_code(self):
|
||||
"""Test not publishing of MQTT messages with invalid code."""
|
||||
self.hass.config.components = ['mqtt']
|
||||
self.hass.config.components = set(['mqtt'])
|
||||
assert setup_component(self.hass, alarm_control_panel.DOMAIN, {
|
||||
alarm_control_panel.DOMAIN: {
|
||||
'platform': 'mqtt',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue