mirror of
https://github.com/home-assistant/core.git
synced 2025-11-12 12:30:31 +00:00
Upgrade black to 20.8b1 (#39287)
This commit is contained in:
@@ -25,7 +25,10 @@ async def test_setup_with_config(hass):
|
||||
async def test_successful_config_entry(hass):
|
||||
"""Test that SpeedTestDotNet is configured successfully."""
|
||||
|
||||
entry = MockConfigEntry(domain=speedtestdotnet.DOMAIN, data={},)
|
||||
entry = MockConfigEntry(
|
||||
domain=speedtestdotnet.DOMAIN,
|
||||
data={},
|
||||
)
|
||||
entry.add_to_hass(hass)
|
||||
|
||||
with patch("speedtest.Speedtest"), patch(
|
||||
@@ -35,13 +38,19 @@ async def test_successful_config_entry(hass):
|
||||
await hass.config_entries.async_setup(entry.entry_id)
|
||||
|
||||
assert entry.state == config_entries.ENTRY_STATE_LOADED
|
||||
assert forward_entry_setup.mock_calls[0][1] == (entry, "sensor",)
|
||||
assert forward_entry_setup.mock_calls[0][1] == (
|
||||
entry,
|
||||
"sensor",
|
||||
)
|
||||
|
||||
|
||||
async def test_setup_failed(hass):
|
||||
"""Test SpeedTestDotNet failed due to an error."""
|
||||
|
||||
entry = MockConfigEntry(domain=speedtestdotnet.DOMAIN, data={},)
|
||||
entry = MockConfigEntry(
|
||||
domain=speedtestdotnet.DOMAIN,
|
||||
data={},
|
||||
)
|
||||
entry.add_to_hass(hass)
|
||||
|
||||
with patch("speedtest.Speedtest", side_effect=speedtest.ConfigRetrievalError):
|
||||
@@ -53,7 +62,10 @@ async def test_setup_failed(hass):
|
||||
|
||||
async def test_unload_entry(hass):
|
||||
"""Test removing SpeedTestDotNet."""
|
||||
entry = MockConfigEntry(domain=speedtestdotnet.DOMAIN, data={},)
|
||||
entry = MockConfigEntry(
|
||||
domain=speedtestdotnet.DOMAIN,
|
||||
data={},
|
||||
)
|
||||
entry.add_to_hass(hass)
|
||||
|
||||
with patch("speedtest.Speedtest"):
|
||||
|
||||
Reference in New Issue
Block a user