Move elevation to core config and clean up HTTP mocking in tests (#2378)
* Stick version numbers * Move elevation to core config * Migrate forecast test to requests-mock * Migrate YR tests to requests-mock * Add requests_mock to requirements_test.txt * Move conf code from bootstrap to config * More config fixes * Fix some more issues * Add test for set config and failing auto detect
This commit is contained in:
1 parent
dc75b28b90
commit
6714392e9c
26 files changed
+1779
-337
No files matched your search
@@ -35,6 +35,7 @@ def get_test_home_assistant(num_threads=None):
|
||||
hass.config.config_dir = get_test_config_dir()
|
||||
hass.config.latitude = 32.87336
|
||||
hass.config.longitude = -117.22743
|
||||
hass.config.elevation = 0
|
||||
hass.config.time_zone = date_util.get_time_zone('US/Pacific')
|
||||
hass.config.temperature_unit = TEMP_CELSIUS
|
||||
|
||||
@@ -105,6 +106,13 @@ def ensure_sun_set(hass):
|
||||
fire_time_changed(hass, sun.next_setting_utc(hass) + timedelta(seconds=10))
|
||||
|
||||
|
||||
def load_fixture(filename):
|
||||
"""Helper to load a fixture."""
|
||||
path = os.path.join(os.path.dirname(__file__), 'fixtures', filename)
|
||||
with open(path) as fp:
|
||||
return fp.read()
|
||||
|
||||
|
||||
def mock_state_change_event(hass, new_state, old_state=None):
|
||||
"""Mock state change envent."""
|
||||
event_data = {
|
||||
|
||||
Reference in new issue
Block a user