forked from home-assistant/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GeoNet NZ Quakes code improvements (home-assistant#32338)
* code quality improvements * code quality improvements and fixed tests * explicitly set unique ids * improve unique id creation * remove entities from entity registry * added test for removing entities from entity registry * revert entity registry handling from sensor and test code * check for entity registry removal in geolocation test case * make import absolute; isort * change quality scale
- Loading branch information
Showing
11 changed files
with
152 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"""Configuration for GeoNet NZ Quakes tests.""" | ||
import pytest | ||
|
||
from homeassistant.components.geonetnz_quakes import ( | ||
CONF_MINIMUM_MAGNITUDE, | ||
CONF_MMI, | ||
DOMAIN, | ||
) | ||
from homeassistant.const import ( | ||
CONF_LATITUDE, | ||
CONF_LONGITUDE, | ||
CONF_RADIUS, | ||
CONF_SCAN_INTERVAL, | ||
CONF_UNIT_SYSTEM, | ||
) | ||
|
||
from tests.common import MockConfigEntry | ||
|
||
|
||
@pytest.fixture | ||
def config_entry(): | ||
"""Create a mock GeoNet NZ Quakes config entry.""" | ||
return MockConfigEntry( | ||
domain=DOMAIN, | ||
data={ | ||
CONF_LATITUDE: -41.2, | ||
CONF_LONGITUDE: 174.7, | ||
CONF_RADIUS: 25, | ||
CONF_UNIT_SYSTEM: "metric", | ||
CONF_SCAN_INTERVAL: 300.0, | ||
CONF_MMI: 4, | ||
CONF_MINIMUM_MAGNITUDE: 0.0, | ||
}, | ||
title="-41.2, 174.7", | ||
unique_id="-41.2, 174.7", | ||
) |
Oops, something went wrong.