More pylint 2 fixes (#15565)
## Description: More fixes flagged by pylint 2 that don't hurt to have before the actual pylint 2 upgrade (which I'll submit soon). ## Checklist: - [ ] The code change is tested and works locally. - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
This commit is contained in:
1 parent
ea18e06b08
commit
2f7b79764a
242 files changed
+284
-284
No files matched your search
+2
-2
@@ -355,7 +355,7 @@ def ensure_auth_manager_loaded(auth_mgr):
|
||||
store._users = OrderedDict()
|
||||
|
||||
|
||||
class MockModule(object):
|
||||
class MockModule:
|
||||
"""Representation of a fake module."""
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
@@ -391,7 +391,7 @@ class MockModule(object):
|
||||
self.async_unload_entry = async_unload_entry
|
||||
|
||||
|
||||
class MockPlatform(object):
|
||||
class MockPlatform:
|
||||
"""Provide a fake platform."""
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
@@ -1225,7 +1225,7 @@ def reported_properties(hass, endpoint):
|
||||
return _ReportedProperties(msg['context']['properties'])
|
||||
|
||||
|
||||
class _ReportedProperties(object):
|
||||
class _ReportedProperties:
|
||||
def __init__(self, properties):
|
||||
self.properties = properties
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ from tests.common import (
|
||||
get_test_home_assistant, assert_setup_component, mock_coro)
|
||||
|
||||
|
||||
class TestFFmpegNoiseSetup(object):
|
||||
class TestFFmpegNoiseSetup:
|
||||
"""Test class for ffmpeg."""
|
||||
|
||||
def setup_method(self):
|
||||
@@ -72,7 +72,7 @@ class TestFFmpegNoiseSetup(object):
|
||||
assert entity.state == 'on'
|
||||
|
||||
|
||||
class TestFFmpegMotionSetup(object):
|
||||
class TestFFmpegMotionSetup:
|
||||
"""Test class for ffmpeg."""
|
||||
|
||||
def setup_method(self):
|
||||
|
||||
@@ -12,7 +12,7 @@ from tests.common import (
|
||||
FUNCTION_PATH = 'homeassistant.components.binary_sensor.workday.get_date'
|
||||
|
||||
|
||||
class TestWorkdaySetup(object):
|
||||
class TestWorkdaySetup:
|
||||
"""Test class for workday sensor."""
|
||||
|
||||
def setup_method(self):
|
||||
|
||||
@@ -30,7 +30,7 @@ def mock_camera(hass):
|
||||
yield
|
||||
|
||||
|
||||
class TestSetupCamera(object):
|
||||
class TestSetupCamera:
|
||||
"""Test class for setup camera."""
|
||||
|
||||
def setup_method(self):
|
||||
@@ -53,7 +53,7 @@ class TestSetupCamera(object):
|
||||
setup_component(self.hass, camera.DOMAIN, config)
|
||||
|
||||
|
||||
class TestGetImage(object):
|
||||
class TestGetImage:
|
||||
"""Test class for camera."""
|
||||
|
||||
def setup_method(self):
|
||||
|
||||
@@ -33,7 +33,7 @@ def mock_load_config():
|
||||
yield
|
||||
|
||||
|
||||
class TestUPCConnect(object):
|
||||
class TestUPCConnect:
|
||||
"""Tests for the Ddwrt device tracker platform."""
|
||||
|
||||
def setup_method(self):
|
||||
|
||||
@@ -12,7 +12,7 @@ from tests.common import (
|
||||
get_test_home_assistant, get_test_instance_port, assert_setup_component)
|
||||
|
||||
|
||||
class TestSetupImageProcessing(object):
|
||||
class TestSetupImageProcessing:
|
||||
"""Test class for setup image processing."""
|
||||
|
||||
def setup_method(self):
|
||||
@@ -48,7 +48,7 @@ class TestSetupImageProcessing(object):
|
||||
assert self.hass.services.has_service(ip.DOMAIN, 'scan')
|
||||
|
||||
|
||||
class TestImageProcessing(object):
|
||||
class TestImageProcessing:
|
||||
"""Test class for image processing."""
|
||||
|
||||
def setup_method(self):
|
||||
@@ -109,7 +109,7 @@ class TestImageProcessing(object):
|
||||
assert state.state == '0'
|
||||
|
||||
|
||||
class TestImageProcessingAlpr(object):
|
||||
class TestImageProcessingAlpr:
|
||||
"""Test class for alpr image processing."""
|
||||
|
||||
def setup_method(self):
|
||||
@@ -211,7 +211,7 @@ class TestImageProcessingAlpr(object):
|
||||
assert event_data[0]['entity_id'] == 'image_processing.demo_alpr'
|
||||
|
||||
|
||||
class TestImageProcessingFace(object):
|
||||
class TestImageProcessingFace:
|
||||
"""Test class for face image processing."""
|
||||
|
||||
def setup_method(self):
|
||||
|
||||
@@ -11,7 +11,7 @@ from tests.common import (
|
||||
get_test_home_assistant, assert_setup_component, load_fixture, mock_coro)
|
||||
|
||||
|
||||
class TestMicrosoftFaceDetectSetup(object):
|
||||
class TestMicrosoftFaceDetectSetup:
|
||||
"""Test class for image processing."""
|
||||
|
||||
def setup_method(self):
|
||||
@@ -74,7 +74,7 @@ class TestMicrosoftFaceDetectSetup(object):
|
||||
assert self.hass.states.get('image_processing.test_local')
|
||||
|
||||
|
||||
class TestMicrosoftFaceDetect(object):
|
||||
class TestMicrosoftFaceDetect:
|
||||
"""Test class for image processing."""
|
||||
|
||||
def setup_method(self):
|
||||
|
||||
@@ -11,7 +11,7 @@ from tests.common import (
|
||||
get_test_home_assistant, assert_setup_component, load_fixture, mock_coro)
|
||||
|
||||
|
||||
class TestMicrosoftFaceIdentifySetup(object):
|
||||
class TestMicrosoftFaceIdentifySetup:
|
||||
"""Test class for image processing."""
|
||||
|
||||
def setup_method(self):
|
||||
@@ -75,7 +75,7 @@ class TestMicrosoftFaceIdentifySetup(object):
|
||||
assert self.hass.states.get('image_processing.test_local')
|
||||
|
||||
|
||||
class TestMicrosoftFaceIdentify(object):
|
||||
class TestMicrosoftFaceIdentify:
|
||||
"""Test class for image processing."""
|
||||
|
||||
def setup_method(self):
|
||||
|
||||
@@ -12,7 +12,7 @@ from tests.common import (
|
||||
get_test_home_assistant, assert_setup_component, load_fixture, mock_coro)
|
||||
|
||||
|
||||
class TestOpenAlprCloudSetup(object):
|
||||
class TestOpenAlprCloudSetup:
|
||||
"""Test class for image processing."""
|
||||
|
||||
def setup_method(self):
|
||||
@@ -103,7 +103,7 @@ class TestOpenAlprCloudSetup(object):
|
||||
setup_component(self.hass, ip.DOMAIN, config)
|
||||
|
||||
|
||||
class TestOpenAlprCloud(object):
|
||||
class TestOpenAlprCloud:
|
||||
"""Test class for image processing."""
|
||||
|
||||
def setup_method(self):
|
||||
|
||||
@@ -26,7 +26,7 @@ def mock_async_subprocess():
|
||||
return async_popen
|
||||
|
||||
|
||||
class TestOpenAlprLocalSetup(object):
|
||||
class TestOpenAlprLocalSetup:
|
||||
"""Test class for image processing."""
|
||||
|
||||
def setup_method(self):
|
||||
@@ -96,7 +96,7 @@ class TestOpenAlprLocalSetup(object):
|
||||
setup_component(self.hass, ip.DOMAIN, config)
|
||||
|
||||
|
||||
class TestOpenAlprLocal(object):
|
||||
class TestOpenAlprLocal:
|
||||
"""Test class for image processing."""
|
||||
|
||||
def setup_method(self):
|
||||
|
||||
@@ -25,7 +25,7 @@ class AttrDict(dict):
|
||||
return self[item]
|
||||
|
||||
|
||||
class MockBlackbird(object):
|
||||
class MockBlackbird:
|
||||
"""Mock for pyblackbird object."""
|
||||
|
||||
def __init__(self):
|
||||
|
||||
@@ -27,7 +27,7 @@ class AttrDict(dict):
|
||||
return self[item]
|
||||
|
||||
|
||||
class MockMonoprice(object):
|
||||
class MockMonoprice:
|
||||
"""Mock for pymonoprice object."""
|
||||
|
||||
def __init__(self):
|
||||
|
||||
@@ -15,7 +15,7 @@ def _create_zone_mock(name, url):
|
||||
return zone
|
||||
|
||||
|
||||
class FakeYamahaDevice(object):
|
||||
class FakeYamahaDevice:
|
||||
"""A fake Yamaha device."""
|
||||
|
||||
def __init__(self, ctrl_url, name, zones=None):
|
||||
|
||||
@@ -65,7 +65,7 @@ async def mock_client(hass, aiohttp_client, registrations=None):
|
||||
return await aiohttp_client(hass.http.app)
|
||||
|
||||
|
||||
class TestHtml5Notify(object):
|
||||
class TestHtml5Notify:
|
||||
"""Tests for HTML5 notify platform."""
|
||||
|
||||
def test_get_service_with_no_json(self):
|
||||
|
||||
@@ -38,7 +38,7 @@ class MockFFmpegDev(ffmpeg.FFmpegBase):
|
||||
self.called_entities = entity_ids
|
||||
|
||||
|
||||
class TestFFmpegSetup(object):
|
||||
class TestFFmpegSetup:
|
||||
"""Test class for ffmpeg."""
|
||||
|
||||
def setup_method(self):
|
||||
|
||||
@@ -9,7 +9,7 @@ from tests.common import (
|
||||
get_test_home_assistant, assert_setup_component, mock_coro, load_fixture)
|
||||
|
||||
|
||||
class TestMicrosoftFaceSetup(object):
|
||||
class TestMicrosoftFaceSetup:
|
||||
"""Test the microsoft face component."""
|
||||
|
||||
def setup_method(self):
|
||||
|
||||
@@ -18,7 +18,7 @@ from tests.common import (
|
||||
)
|
||||
|
||||
|
||||
class TestMqttEventStream(object):
|
||||
class TestMqttEventStream:
|
||||
"""Test the MQTT eventstream module."""
|
||||
|
||||
def setup_method(self):
|
||||
|
||||
@@ -12,7 +12,7 @@ from tests.common import (
|
||||
)
|
||||
|
||||
|
||||
class TestMqttStateStream(object):
|
||||
class TestMqttStateStream:
|
||||
"""Test the MQTT statestream module."""
|
||||
|
||||
def setup_method(self):
|
||||
|
||||
@@ -41,7 +41,7 @@ GOOD_CONFIG = {
|
||||
}
|
||||
|
||||
|
||||
class _MockState(object):
|
||||
class _MockState:
|
||||
|
||||
def __init__(self, state=None):
|
||||
self.state = state
|
||||
|
||||
@@ -10,7 +10,7 @@ from tests.common import (
|
||||
get_test_home_assistant, assert_setup_component)
|
||||
|
||||
|
||||
class TestRestCommandSetup(object):
|
||||
class TestRestCommandSetup:
|
||||
"""Test the rest command component."""
|
||||
|
||||
def setup_method(self):
|
||||
@@ -47,7 +47,7 @@ class TestRestCommandSetup(object):
|
||||
assert self.hass.services.has_service(rc.DOMAIN, 'test_get')
|
||||
|
||||
|
||||
class TestRestCommandComponent(object):
|
||||
class TestRestCommandComponent:
|
||||
"""Test the rest command component."""
|
||||
|
||||
def setup_method(self):
|
||||
|
||||
@@ -15,7 +15,7 @@ from tests.common import (
|
||||
from .test_init import mutagen_mock # noqa
|
||||
|
||||
|
||||
class TestTTSGooglePlatform(object):
|
||||
class TestTTSGooglePlatform:
|
||||
"""Test the Google speech component."""
|
||||
|
||||
def setup_method(self):
|
||||
|
||||
@@ -29,7 +29,7 @@ def mutagen_mock():
|
||||
yield
|
||||
|
||||
|
||||
class TestTTS(object):
|
||||
class TestTTS:
|
||||
"""Test the Google speech component."""
|
||||
|
||||
def setup_method(self):
|
||||
|
||||
@@ -14,7 +14,7 @@ from tests.common import (
|
||||
from .test_init import mutagen_mock # noqa
|
||||
|
||||
|
||||
class TestTTSMaryTTSPlatform(object):
|
||||
class TestTTSMaryTTSPlatform:
|
||||
"""Test the speech component."""
|
||||
|
||||
def setup_method(self):
|
||||
|
||||
@@ -14,7 +14,7 @@ from tests.common import (
|
||||
from .test_init import mutagen_mock # noqa
|
||||
|
||||
|
||||
class TestTTSVoiceRSSPlatform(object):
|
||||
class TestTTSVoiceRSSPlatform:
|
||||
"""Test the voicerss speech component."""
|
||||
|
||||
def setup_method(self):
|
||||
|
||||
@@ -13,7 +13,7 @@ from tests.common import (
|
||||
from .test_init import mutagen_mock # noqa
|
||||
|
||||
|
||||
class TestTTSYandexPlatform(object):
|
||||
class TestTTSYandexPlatform:
|
||||
"""Test the speech component."""
|
||||
|
||||
def setup_method(self):
|
||||
|
||||
@@ -8,7 +8,7 @@ from homeassistant.helpers.dispatcher import (
|
||||
from tests.common import get_test_home_assistant
|
||||
|
||||
|
||||
class TestHelpersDispatcher(object):
|
||||
class TestHelpersDispatcher:
|
||||
"""Tests for discovery helper methods."""
|
||||
|
||||
def setup_method(self, method):
|
||||
|
||||
@@ -71,7 +71,7 @@ def test_async_update_support(hass):
|
||||
assert len(async_update) == 1
|
||||
|
||||
|
||||
class TestHelpersEntity(object):
|
||||
class TestHelpersEntity:
|
||||
"""Test homeassistant.helpers.entity module."""
|
||||
|
||||
def setup_method(self, method):
|
||||
|
||||
@@ -221,7 +221,7 @@ class TestUtil(unittest.TestCase):
|
||||
|
||||
def test_throttle_per_instance(self):
|
||||
"""Test that the throttle method is done per instance of a class."""
|
||||
class Tester(object):
|
||||
class Tester:
|
||||
"""A tester class for the throttle."""
|
||||
|
||||
@util.Throttle(timedelta(seconds=1))
|
||||
@@ -234,7 +234,7 @@ class TestUtil(unittest.TestCase):
|
||||
|
||||
def test_throttle_on_method(self):
|
||||
"""Test that throttle works when wrapping a method."""
|
||||
class Tester(object):
|
||||
class Tester:
|
||||
"""A tester class for the throttle."""
|
||||
|
||||
def hello(self):
|
||||
@@ -249,7 +249,7 @@ class TestUtil(unittest.TestCase):
|
||||
|
||||
def test_throttle_on_two_method(self):
|
||||
"""Test that throttle works when wrapping two methods."""
|
||||
class Tester(object):
|
||||
class Tester:
|
||||
"""A test class for the throttle."""
|
||||
|
||||
@util.Throttle(timedelta(seconds=1))
|
||||
|
||||
Reference in new issue
Block a user