Split bootstrap into bs + setup (#6416)

* Split bootstrap into bs + setup

* Lint
This commit is contained in:
Paulus Schoutsen authored and Pascal Vizeli committed 2017-03-05 10:41:54 +01:00
1 parent bdf948d866
commit 2650c73a89
171 files changed
+972 -959

No files matched your search

+7 -7
View File
@@ -4,7 +4,7 @@ import shutil
import unittest
from unittest.mock import Mock, patch
from homeassistant import bootstrap
from homeassistant import setup
from homeassistant.components import panel_custom
from tests.common import get_test_home_assistant
@@ -34,15 +34,15 @@ class TestPanelCustom(unittest.TestCase):
}
}
assert not bootstrap.setup_component(self.hass, 'panel_custom', config)
assert not setup.setup_component(self.hass, 'panel_custom', config)
assert not mock_register.called
path = self.hass.config.path(panel_custom.PANEL_DIR)
os.mkdir(path)
self.hass.data.pop(bootstrap.DATA_SETUP)
self.hass.data.pop(setup.DATA_SETUP)
with open(os.path.join(path, 'todomvc.html'), 'a'):
assert bootstrap.setup_component(self.hass, 'panel_custom', config)
assert setup.setup_component(self.hass, 'panel_custom', config)
assert mock_register.called
@patch('homeassistant.components.panel_custom.register_panel')
@@ -62,16 +62,16 @@ class TestPanelCustom(unittest.TestCase):
}
with patch('os.path.isfile', Mock(return_value=False)):
assert not bootstrap.setup_component(
assert not setup.setup_component(
self.hass, 'panel_custom', config
)
assert not mock_register.called
self.hass.data.pop(bootstrap.DATA_SETUP)
self.hass.data.pop(setup.DATA_SETUP)
with patch('os.path.isfile', Mock(return_value=True)):
with patch('os.access', Mock(return_value=True)):
assert bootstrap.setup_component(
assert setup.setup_component(
self.hass, 'panel_custom', config
)