Tests: Mock get_local_ip by default too

This commit is contained in:
Paulus Schoutsen committed 2016-02-14 22:01:30 -08:00
1 parent 09ab3e95c0
commit 8d366a7367
6 files changed
+9 -22

No files matched your search

@@ -28,9 +28,7 @@ def _url(data={}):
return "{}{}locative?{}".format(HTTP_BASE_URL, const.URL_API, data)
@patch('homeassistant.components.http.util.get_local_ip',
return_value='127.0.0.1')
def setUpModule(mock_get_local_ip): # pylint: disable=invalid-name
def setUpModule(): # pylint: disable=invalid-name
""" Initalizes a Home Assistant server. """
global hass
+1 -4
View File
@@ -7,7 +7,6 @@ Tests Home Assistant Alexa component does what it should do.
# pylint: disable=protected-access,too-many-public-methods
import unittest
import json
from unittest.mock import patch
import requests
@@ -29,9 +28,7 @@ hass = None
calls = []
@patch('homeassistant.components.http.util.get_local_ip',
return_value='127.0.0.1')
def setUpModule(mock_get_local_ip): # pylint: disable=invalid-name
def setUpModule(): # pylint: disable=invalid-name
""" Initalize a Home Assistant server for testing this module. """
global hass
+1 -3
View File
@@ -32,9 +32,7 @@ def _url(path=""):
return HTTP_BASE_URL + path
@patch('homeassistant.components.http.util.get_local_ip',
return_value='127.0.0.1')
def setUpModule(mock_get_local_ip): # pylint: disable=invalid-name
def setUpModule(): # pylint: disable=invalid-name
""" Initializes a Home Assistant server. """
global hass
+1 -4
View File
@@ -7,7 +7,6 @@ Tests Home Assistant HTTP component does what it should do.
# pylint: disable=protected-access,too-many-public-methods
import re
import unittest
from unittest.mock import patch
import requests
@@ -30,9 +29,7 @@ def _url(path=""):
return HTTP_BASE_URL + path
@patch('homeassistant.components.http.util.get_local_ip',
return_value='127.0.0.1')
def setUpModule(mock_get_local_ip): # pylint: disable=invalid-name
def setUpModule(): # pylint: disable=invalid-name
""" Initalizes a Home Assistant server. """
global hass