Fix config test when current version is 92 (#23356)

This commit is contained in:
Paulus Schoutsen 2019-04-24 13:37:08 -07:00 committed by GitHub
parent d53a00d054
commit d218ba98e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -318,7 +318,8 @@ class TestConfig(unittest.TestCase):
ha_version = '0.92.0'
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), \
mock.patch.object(config_util, '__version__', '0.91.0'):
opened_file = mock_open.return_value
# pylint: disable=no-member
opened_file.readline.return_value = ha_version
@ -326,7 +327,7 @@ class TestConfig(unittest.TestCase):
config_util.process_ha_config_upgrade(self.hass)
assert opened_file.write.call_count == 1
assert opened_file.write.call_args == mock.call(__version__)
assert opened_file.write.call_args == mock.call('0.91.0')
def test_config_upgrade_same_version(self):
"""Test no update of version on no upgrade."""