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
|
@ -53,7 +53,7 @@ class TestLightMQTTJSON(unittest.TestCase):
|
|||
def test_fail_setup_if_no_command_topic(self): \
|
||||
# pylint: disable=invalid-name
|
||||
"""Test if setup fails 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, light.DOMAIN, {
|
||||
light.DOMAIN: {
|
||||
|
@ -66,7 +66,7 @@ class TestLightMQTTJSON(unittest.TestCase):
|
|||
def test_no_color_or_brightness_if_no_config(self): \
|
||||
# pylint: disable=invalid-name
|
||||
"""Test if there is no color and brightness if they aren't defined."""
|
||||
self.hass.config.components = ['mqtt']
|
||||
self.hass.config.components = set(['mqtt'])
|
||||
assert setup_component(self.hass, light.DOMAIN, {
|
||||
light.DOMAIN: {
|
||||
'platform': 'mqtt_json',
|
||||
|
@ -92,7 +92,7 @@ class TestLightMQTTJSON(unittest.TestCase):
|
|||
def test_controlling_state_via_topic(self): \
|
||||
# pylint: disable=invalid-name
|
||||
"""Test the controlling of the state via topic."""
|
||||
self.hass.config.components = ['mqtt']
|
||||
self.hass.config.components = set(['mqtt'])
|
||||
assert setup_component(self.hass, light.DOMAIN, {
|
||||
light.DOMAIN: {
|
||||
'platform': 'mqtt_json',
|
||||
|
@ -152,7 +152,7 @@ class TestLightMQTTJSON(unittest.TestCase):
|
|||
def test_sending_mqtt_commands_and_optimistic(self): \
|
||||
# pylint: disable=invalid-name
|
||||
"""Test the sending of command in optimistic mode."""
|
||||
self.hass.config.components = ['mqtt']
|
||||
self.hass.config.components = set(['mqtt'])
|
||||
assert setup_component(self.hass, light.DOMAIN, {
|
||||
light.DOMAIN: {
|
||||
'platform': 'mqtt_json',
|
||||
|
@ -208,7 +208,7 @@ class TestLightMQTTJSON(unittest.TestCase):
|
|||
def test_flash_short_and_long(self): \
|
||||
# pylint: disable=invalid-name
|
||||
"""Test for flash length being sent when included."""
|
||||
self.hass.config.components = ['mqtt']
|
||||
self.hass.config.components = set(['mqtt'])
|
||||
assert setup_component(self.hass, light.DOMAIN, {
|
||||
light.DOMAIN: {
|
||||
'platform': 'mqtt_json',
|
||||
|
@ -250,7 +250,7 @@ class TestLightMQTTJSON(unittest.TestCase):
|
|||
|
||||
def test_transition(self):
|
||||
"""Test for transition time being sent when included."""
|
||||
self.hass.config.components = ['mqtt']
|
||||
self.hass.config.components = set(['mqtt'])
|
||||
assert setup_component(self.hass, light.DOMAIN, {
|
||||
light.DOMAIN: {
|
||||
'platform': 'mqtt_json',
|
||||
|
@ -292,7 +292,7 @@ class TestLightMQTTJSON(unittest.TestCase):
|
|||
def test_invalid_color_and_brightness_values(self): \
|
||||
# pylint: disable=invalid-name
|
||||
"""Test that invalid color/brightness values are ignored."""
|
||||
self.hass.config.components = ['mqtt']
|
||||
self.hass.config.components = set(['mqtt'])
|
||||
assert setup_component(self.hass, light.DOMAIN, {
|
||||
light.DOMAIN: {
|
||||
'platform': 'mqtt_json',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue