Upgrade black to 20.8b1 (#39287)
This commit is contained in:
1 parent
0d7eec710c
commit
1c2ebdf307
574 files changed
+4389
-1725
No files matched your search
@@ -25,10 +25,12 @@ async def test_form(hass):
|
||||
), patch(
|
||||
"homeassistant.components.dexcom.async_setup", return_value=True
|
||||
) as mock_setup, patch(
|
||||
"homeassistant.components.dexcom.async_setup_entry", return_value=True,
|
||||
"homeassistant.components.dexcom.async_setup_entry",
|
||||
return_value=True,
|
||||
) as mock_setup_entry:
|
||||
result2 = await hass.config_entries.flow.async_configure(
|
||||
result["flow_id"], CONFIG,
|
||||
result["flow_id"],
|
||||
CONFIG,
|
||||
)
|
||||
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
@@ -46,10 +48,12 @@ async def test_form_account_error(hass):
|
||||
)
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.dexcom.config_flow.Dexcom", side_effect=AccountError,
|
||||
"homeassistant.components.dexcom.config_flow.Dexcom",
|
||||
side_effect=AccountError,
|
||||
):
|
||||
result2 = await hass.config_entries.flow.async_configure(
|
||||
result["flow_id"], CONFIG,
|
||||
result["flow_id"],
|
||||
CONFIG,
|
||||
)
|
||||
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
@@ -63,10 +67,12 @@ async def test_form_session_error(hass):
|
||||
)
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.dexcom.config_flow.Dexcom", side_effect=SessionError,
|
||||
"homeassistant.components.dexcom.config_flow.Dexcom",
|
||||
side_effect=SessionError,
|
||||
):
|
||||
result2 = await hass.config_entries.flow.async_configure(
|
||||
result["flow_id"], CONFIG,
|
||||
result["flow_id"],
|
||||
CONFIG,
|
||||
)
|
||||
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
@@ -80,10 +86,12 @@ async def test_form_unknown_error(hass):
|
||||
)
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.dexcom.config_flow.Dexcom", side_effect=Exception,
|
||||
"homeassistant.components.dexcom.config_flow.Dexcom",
|
||||
side_effect=Exception,
|
||||
):
|
||||
result2 = await hass.config_entries.flow.async_configure(
|
||||
result["flow_id"], CONFIG,
|
||||
result["flow_id"],
|
||||
CONFIG,
|
||||
)
|
||||
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
@@ -92,7 +100,11 @@ async def test_form_unknown_error(hass):
|
||||
|
||||
async def test_option_flow_default(hass):
|
||||
"""Test config flow options."""
|
||||
entry = MockConfigEntry(domain=DOMAIN, data=CONFIG, options=None,)
|
||||
entry = MockConfigEntry(
|
||||
domain=DOMAIN,
|
||||
data=CONFIG,
|
||||
options=None,
|
||||
)
|
||||
entry.add_to_hass(hass)
|
||||
|
||||
result = await hass.config_entries.options.async_init(entry.entry_id)
|
||||
@@ -101,7 +113,8 @@ async def test_option_flow_default(hass):
|
||||
assert result["step_id"] == "init"
|
||||
|
||||
result2 = await hass.config_entries.options.async_configure(
|
||||
result["flow_id"], user_input={},
|
||||
result["flow_id"],
|
||||
user_input={},
|
||||
)
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result2["data"] == {
|
||||
@@ -112,7 +125,9 @@ async def test_option_flow_default(hass):
|
||||
async def test_option_flow(hass):
|
||||
"""Test config flow options."""
|
||||
entry = MockConfigEntry(
|
||||
domain=DOMAIN, data=CONFIG, options={CONF_UNIT_OF_MEASUREMENT: MG_DL},
|
||||
domain=DOMAIN,
|
||||
data=CONFIG,
|
||||
options={CONF_UNIT_OF_MEASUREMENT: MG_DL},
|
||||
)
|
||||
entry.add_to_hass(hass)
|
||||
|
||||
@@ -122,7 +137,8 @@ async def test_option_flow(hass):
|
||||
assert result["step_id"] == "init"
|
||||
|
||||
result = await hass.config_entries.options.async_configure(
|
||||
result["flow_id"], user_input={CONF_UNIT_OF_MEASUREMENT: MMOL_L},
|
||||
result["flow_id"],
|
||||
user_input={CONF_UNIT_OF_MEASUREMENT: MMOL_L},
|
||||
)
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result["data"] == {
|
||||
|
||||
@@ -19,7 +19,8 @@ async def test_setup_entry_account_error(hass):
|
||||
options=None,
|
||||
)
|
||||
with patch(
|
||||
"homeassistant.components.dexcom.Dexcom", side_effect=AccountError,
|
||||
"homeassistant.components.dexcom.Dexcom",
|
||||
side_effect=AccountError,
|
||||
):
|
||||
entry.add_to_hass(hass)
|
||||
result = await hass.config_entries.async_setup(entry.entry_id)
|
||||
@@ -38,7 +39,8 @@ async def test_setup_entry_session_error(hass):
|
||||
options=None,
|
||||
)
|
||||
with patch(
|
||||
"homeassistant.components.dexcom.Dexcom", side_effect=SessionError,
|
||||
"homeassistant.components.dexcom.Dexcom",
|
||||
side_effect=SessionError,
|
||||
):
|
||||
entry.add_to_hass(hass)
|
||||
result = await hass.config_entries.async_setup(entry.entry_id)
|
||||
|
||||
@@ -98,7 +98,8 @@ async def test_sensors_options_changed(hass):
|
||||
return_value="test_session_id",
|
||||
):
|
||||
hass.config_entries.async_update_entry(
|
||||
entry=entry, options={CONF_UNIT_OF_MEASUREMENT: MMOL_L},
|
||||
entry=entry,
|
||||
options={CONF_UNIT_OF_MEASUREMENT: MMOL_L},
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
|
||||
Reference in new issue
Block a user