From 6f27c5ae46f772dabeccd7b775b9b1c9e7df754c Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 10 Sep 2019 13:07:55 -0700 Subject: [PATCH] Fix tests --- tests/helpers/test_translation.py | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/tests/helpers/test_translation.py b/tests/helpers/test_translation.py index f4218fb1a7e..1c3748250a5 100644 --- a/tests/helpers/test_translation.py +++ b/tests/helpers/test_translation.py @@ -95,30 +95,23 @@ async def test_get_translations(hass, mock_config_flows): assert await async_setup_component(hass, "switch", {"switch": {"platform": "test"}}) translations = await translation.async_get_translations(hass, "en") - assert translations == { - "component.switch.state.string1": "Value 1", - "component.switch.state.string2": "Value 2", - } + + assert translations["component.switch.state.string1"] == "Value 1" + assert translations["component.switch.state.string2"] == "Value 2" translations = await translation.async_get_translations(hass, "de") - assert translations == { - "component.switch.state.string1": "German Value 1", - "component.switch.state.string2": "German Value 2", - } + assert translations["component.switch.state.string1"] == "German Value 1" + assert translations["component.switch.state.string2"] == "German Value 2" # Test a partial translation translations = await translation.async_get_translations(hass, "es") - assert translations == { - "component.switch.state.string1": "Spanish Value 1", - "component.switch.state.string2": "Value 2", - } + assert translations["component.switch.state.string1"] == "Spanish Value 1" + assert translations["component.switch.state.string2"] == "Value 2" # Test that an untranslated language falls back to English. translations = await translation.async_get_translations(hass, "invalid-language") - assert translations == { - "component.switch.state.string1": "Value 1", - "component.switch.state.string2": "Value 2", - } + assert translations["component.switch.state.string1"] == "Value 1" + assert translations["component.switch.state.string2"] == "Value 2" async def test_get_translations_loads_config_flows(hass, mock_config_flows):