2016-03-09 09:25:50 +00:00
|
|
|
"""Test the initialization."""
|
2015-12-28 01:37:32 +00:00
|
|
|
import betamax
|
|
|
|
|
2016-02-15 06:01:30 +00:00
|
|
|
from homeassistant import util
|
2016-02-03 05:33:59 +00:00
|
|
|
from homeassistant.util import location
|
|
|
|
|
2015-12-28 01:37:32 +00:00
|
|
|
with betamax.Betamax.configure() as config:
|
|
|
|
config.cassette_library_dir = 'tests/cassettes'
|
2016-02-03 05:33:59 +00:00
|
|
|
|
2016-02-05 06:26:02 +00:00
|
|
|
# Automatically called during different setups. Too often forgotten
|
|
|
|
# so mocked by default.
|
|
|
|
location.detect_location_info = lambda: location.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,
|
|
|
|
)
|
|
|
|
|
|
|
|
location.elevation = lambda latitude, longitude: 0
|
2016-02-15 06:01:30 +00:00
|
|
|
util.get_local_ip = lambda: '127.0.0.1'
|