From f0ce6c82102bc45fddda52064da20efd7b5ec844 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 12 May 2017 20:14:17 -0700 Subject: [PATCH] Update netdisco (#7563) --- homeassistant/components/discovery.py | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 3 --- script/gen_requirements_all.py | 1 - tests/components/test_discovery.py | 12 +++++++++++- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/discovery.py b/homeassistant/components/discovery.py index 4641241ea51..261d8953940 100644 --- a/homeassistant/components/discovery.py +++ b/homeassistant/components/discovery.py @@ -21,7 +21,7 @@ from homeassistant.helpers.event import async_track_point_in_utc_time from homeassistant.helpers.discovery import async_load_platform, async_discover import homeassistant.util.dt as dt_util -REQUIREMENTS = ['netdisco==1.0.0rc3'] +REQUIREMENTS = ['netdisco==1.0.0'] DOMAIN = 'discovery' diff --git a/requirements_all.txt b/requirements_all.txt index 7e57538711e..2a10480f3a5 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -385,7 +385,7 @@ mutagen==1.37.0 myusps==1.0.5 # homeassistant.components.discovery -netdisco==1.0.0rc3 +netdisco==1.0.0 # homeassistant.components.sensor.neurio_energy neurio==0.3.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index ef73b6d3621..c6375e4b232 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -78,9 +78,6 @@ mficlient==0.3.0 # homeassistant.components.tts mutagen==1.37.0 -# homeassistant.components.discovery -netdisco==1.0.0rc3 - # homeassistant.components.mqtt paho-mqtt==1.2.3 diff --git a/script/gen_requirements_all.py b/script/gen_requirements_all.py index 59299f36453..e1f005a3668 100755 --- a/script/gen_requirements_all.py +++ b/script/gen_requirements_all.py @@ -50,7 +50,6 @@ TEST_REQUIREMENTS = ( 'pilight', 'fuzzywuzzy', 'datadog', - 'netdisco', 'rflink', 'ring_doorbell', 'sleepyq', diff --git a/tests/components/test_discovery.py b/tests/components/test_discovery.py index d5be9c483ad..580d876982d 100644 --- a/tests/components/test_discovery.py +++ b/tests/components/test_discovery.py @@ -1,8 +1,9 @@ """The tests for the discovery component.""" import asyncio import os +from unittest.mock import patch, MagicMock -from unittest.mock import patch +import pytest from homeassistant.bootstrap import async_setup_component from homeassistant.components import discovery @@ -34,6 +35,15 @@ IGNORE_CONFIG = { } +@pytest.fixture(autouse=True) +def netdisco_mock(): + """Mock netdisco.""" + with patch.dict('sys.modules', { + 'netdisco.discovery': MagicMock(), + }): + yield + + @asyncio.coroutine def mock_discovery(hass, discoveries, config=BASE_CONFIG): """Helper to mock discoveries."""