mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Cleaned up tests a bit
This commit is contained in:
parent
244e2a0e7e
commit
fa3b63f5e5
@ -6,12 +6,18 @@ Tests the group compoments.
|
||||
"""
|
||||
# pylint: disable=protected-access,too-many-public-methods
|
||||
import unittest
|
||||
import logging
|
||||
|
||||
import homeassistant as ha
|
||||
import homeassistant.components as comps
|
||||
import homeassistant.components.group as group
|
||||
|
||||
|
||||
def setUpModule(): # pylint: disable=invalid-name
|
||||
""" Setup to ignore group errors. """
|
||||
logging.disable(logging.CRITICAL)
|
||||
|
||||
|
||||
class TestComponentsGroup(unittest.TestCase):
|
||||
""" Tests homeassistant.components.group module. """
|
||||
|
||||
|
@ -8,7 +8,6 @@ Tests Home Assistant HTTP component does what it should do.
|
||||
import re
|
||||
import unittest
|
||||
import json
|
||||
import logging
|
||||
|
||||
import requests
|
||||
|
||||
@ -27,13 +26,15 @@ HTTP_BASE_URL = "http://127.0.0.1:{}".format(SERVER_PORT)
|
||||
|
||||
HA_HEADERS = {remote.AUTH_HEADER: API_PASSWORD}
|
||||
|
||||
hass = None
|
||||
|
||||
|
||||
def _url(path=""):
|
||||
""" Helper method to generate urls. """
|
||||
return HTTP_BASE_URL + path
|
||||
|
||||
|
||||
def setUpModule():
|
||||
def setUpModule(): # pylint: disable=invalid-name
|
||||
""" Initalizes a Home Assistant server. """
|
||||
global hass
|
||||
|
||||
@ -49,7 +50,7 @@ def setUpModule():
|
||||
hass.start()
|
||||
|
||||
|
||||
def tearDownModule():
|
||||
def tearDownModule(): # pylint: disable=invalid-name
|
||||
""" Stops the Home Assistant server. """
|
||||
global hass
|
||||
|
||||
|
@ -5,6 +5,7 @@ test.test_core
|
||||
Provides tests to verify that Home Assistant core works.
|
||||
"""
|
||||
# pylint: disable=protected-access,too-many-public-methods
|
||||
# pylint: disable=too-few-public-methods
|
||||
import os
|
||||
import unittest
|
||||
import time
|
||||
|
@ -4,7 +4,7 @@ test.test_loader
|
||||
|
||||
Provides tests to verify that we can load components.
|
||||
"""
|
||||
# pylint: disable=too-many-public-methods
|
||||
# pylint: disable=too-many-public-methods,protected-access
|
||||
import unittest
|
||||
|
||||
import homeassistant as ha
|
||||
|
@ -6,7 +6,6 @@ Tests Home Assistant remote methods and classes.
|
||||
"""
|
||||
# pylint: disable=protected-access,too-many-public-methods
|
||||
import unittest
|
||||
import logging
|
||||
|
||||
import homeassistant as ha
|
||||
import homeassistant.remote as remote
|
||||
@ -18,13 +17,15 @@ HTTP_BASE_URL = "http://127.0.0.1:{}".format(remote.SERVER_PORT)
|
||||
|
||||
HA_HEADERS = {remote.AUTH_HEADER: API_PASSWORD}
|
||||
|
||||
hass, slave, master_api = None, None, None
|
||||
|
||||
|
||||
def _url(path=""):
|
||||
""" Helper method to generate urls. """
|
||||
return HTTP_BASE_URL + path
|
||||
|
||||
|
||||
def setUpModule():
|
||||
def setUpModule(): # pylint: disable=invalid-name
|
||||
""" Initalizes a Home Assistant server and Slave instance. """
|
||||
global hass, slave, master_api
|
||||
|
||||
@ -51,7 +52,7 @@ def setUpModule():
|
||||
slave.start()
|
||||
|
||||
|
||||
def tearDownModule():
|
||||
def tearDownModule(): # pylint: disable=invalid-name
|
||||
""" Stops the Home Assistant server and slave. """
|
||||
global hass, slave
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user