Mock util.location by default
This commit is contained in:
parent
2c4166b5f2
commit
a5db23afa4
3 changed files with 20 additions and 23 deletions
|
@ -9,7 +9,6 @@ from datetime import timedelta
|
|||
from unittest import mock
|
||||
|
||||
from homeassistant import core as ha, loader
|
||||
import homeassistant.util.location as location_util
|
||||
from homeassistant.helpers.entity import ToggleEntity
|
||||
from homeassistant.const import (
|
||||
STATE_ON, STATE_OFF, DEVICE_DEFAULT_NAME, EVENT_TIME_CHANGED,
|
||||
|
@ -44,23 +43,6 @@ def get_test_home_assistant(num_threads=None):
|
|||
return hass
|
||||
|
||||
|
||||
def mock_detect_location_info():
|
||||
""" Mock implementation of util.detect_location_info. """
|
||||
return location_util.LocationInfo(
|
||||
ip='1.1.1.1',
|
||||
country_code='US',
|
||||
country_name='United States',
|
||||
region_code='CA',
|
||||
region_name='California',
|
||||
city='San Diego',
|
||||
zip_code='92122',
|
||||
time_zone='America/Los_Angeles',
|
||||
latitude='2.0',
|
||||
longitude='1.0',
|
||||
use_fahrenheit=True,
|
||||
)
|
||||
|
||||
|
||||
def mock_service(hass, domain, service):
|
||||
"""
|
||||
Sets up a fake service.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue