Cleaned up tests a bit

This commit is contained in:
Paulus Schoutsen 2014-11-23 22:18:51 -08:00
parent 244e2a0e7e
commit fa3b63f5e5
5 changed files with 16 additions and 7 deletions

View File

@ -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. """

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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