Update persistent deps dir version in config.py (#8479)

* Update persistent deps dir version in config.py

* Update last version to remove deps dir in tests
This commit is contained in:
Paulus Schoutsen 2017-07-19 22:59:21 -07:00 committed by GitHub
parent 8d1999dc12
commit 49c399c358
2 changed files with 4 additions and 4 deletions

View file

@ -297,8 +297,8 @@ def process_ha_config_upgrade(hass):
_LOGGER.info("Upgrading configuration directory from %s to %s", _LOGGER.info("Upgrading configuration directory from %s to %s",
conf_version, __version__) conf_version, __version__)
if LooseVersion(conf_version) < LooseVersion('0.49'): if LooseVersion(conf_version) < LooseVersion('0.50'):
# 0.49 introduced persistent deps dir. # 0.50 introduced persistent deps dir.
lib_path = hass.config.path('deps') lib_path = hass.config.path('deps')
if os.path.isdir(lib_path): if os.path.isdir(lib_path):
shutil.rmtree(lib_path) shutil.rmtree(lib_path)

View file

@ -260,8 +260,8 @@ class TestConfig(unittest.TestCase):
@mock.patch('homeassistant.config.shutil') @mock.patch('homeassistant.config.shutil')
@mock.patch('homeassistant.config.os') @mock.patch('homeassistant.config.os')
def test_remove_lib_on_upgrade(self, mock_os, mock_shutil): def test_remove_lib_on_upgrade(self, mock_os, mock_shutil):
"""Test removal of library on upgrade from before 0.49.""" """Test removal of library on upgrade from before 0.50."""
ha_version = '0.48.0' ha_version = '0.49.0'
mock_os.path.isdir = mock.Mock(return_value=True) mock_os.path.isdir = mock.Mock(return_value=True)
mock_open = mock.mock_open() mock_open = mock.mock_open()
with mock.patch('homeassistant.config.open', mock_open, create=True): with mock.patch('homeassistant.config.open', mock_open, create=True):