No longer allow invalid slugs or extra keys (#24176)

* No longer allow slugs

* Lint

* Remove HASchema

* Lint

* Fix tests
This commit is contained in:
Paulus Schoutsen authored and Pascal Vizeli committed 2019-05-30 13:33:26 +02:00
1 parent b3d8f8620c
commit 59ce31f44f
6 files changed
+8 -275

No files matched your search

@@ -612,7 +612,6 @@ async def test_setting_attribute_via_mqtt_json_message(hass, mqtt_mock):
vacuum.DOMAIN: {
'platform': 'mqtt',
'name': 'test',
'state_topic': 'test-topic',
'json_attributes_topic': 'attr-topic'
}
})
@@ -629,7 +628,6 @@ async def test_update_with_json_attrs_not_dict(hass, mqtt_mock, caplog):
vacuum.DOMAIN: {
'platform': 'mqtt',
'name': 'test',
'state_topic': 'test-topic',
'json_attributes_topic': 'attr-topic'
}
})
@@ -647,7 +645,6 @@ async def test_update_with_json_attrs_bad_json(hass, mqtt_mock, caplog):
vacuum.DOMAIN: {
'platform': 'mqtt',
'name': 'test',
'state_topic': 'test-topic',
'json_attributes_topic': 'attr-topic'
}
})
@@ -766,7 +763,6 @@ async def test_entity_device_info_update(hass, mqtt_mock):
config = {
'platform': 'mqtt',
'name': 'Test 1',
'state_topic': 'test-topic',
'command_topic': 'test-command-topic',
'device': {
'identifiers': ['helloworld'],
+5 -14
View File
@@ -331,8 +331,7 @@ async def test_discovery_removal_vacuum(hass, mqtt_mock):
data = (
'{ "name": "Beer",'
' "command_topic": "test_topic",'
' "component": "state" }'
' "command_topic": "test_topic"}'
)
async_fire_mqtt_message(hass, 'homeassistant/vacuum/bla/config',
@@ -357,13 +356,11 @@ async def test_discovery_broken(hass, mqtt_mock, caplog):
data1 = (
'{ "name": "Beer",'
' "command_topic": "test_topic#",'
' "component": "state" }'
' "command_topic": "test_topic#"}'
)
data2 = (
'{ "name": "Milk",'
' "command_topic": "test_topic",'
' "component": "state" }'
' "command_topic": "test_topic"}'
)
async_fire_mqtt_message(hass, 'homeassistant/vacuum/bla/config',
@@ -391,13 +388,11 @@ async def test_discovery_update_vacuum(hass, mqtt_mock):
data1 = (
'{ "name": "Beer",'
' "command_topic": "test_topic",'
'"component": "state" }'
' "command_topic": "test_topic"}'
)
data2 = (
'{ "name": "Milk",'
' "command_topic": "test_topic",'
' "component": "state"}'
' "command_topic": "test_topic"}'
)
async_fire_mqtt_message(hass, 'homeassistant/vacuum/bla/config',
@@ -425,7 +420,6 @@ async def test_setting_attribute_via_mqtt_json_message(hass, mqtt_mock):
vacuum.DOMAIN: {
'platform': 'mqtt',
'name': 'test',
'state_topic': 'test-topic',
'json_attributes_topic': 'attr-topic'
}
})
@@ -442,7 +436,6 @@ async def test_update_with_json_attrs_not_dict(hass, mqtt_mock, caplog):
vacuum.DOMAIN: {
'platform': 'mqtt',
'name': 'test',
'state_topic': 'test-topic',
'json_attributes_topic': 'attr-topic'
}
})
@@ -460,7 +453,6 @@ async def test_update_with_json_attrs_bad_json(hass, mqtt_mock, caplog):
vacuum.DOMAIN: {
'platform': 'mqtt',
'name': 'test',
'state_topic': 'test-topic',
'json_attributes_topic': 'attr-topic'
}
})
@@ -579,7 +571,6 @@ async def test_entity_device_info_update(hass, mqtt_mock):
config = {
'platform': 'mqtt',
'name': 'Test 1',
'state_topic': 'test-topic',
'command_topic': 'test-command-topic',
'device': {
'identifiers': ['helloworld'],