mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
committed by
Teagan Glenn
parent
a0a509ceea
commit
3bbcf4d8b1
@@ -2,6 +2,7 @@
|
||||
import unittest
|
||||
|
||||
from homeassistant.components import weblink
|
||||
from homeassistant import bootstrap
|
||||
|
||||
from tests.common import get_test_home_assistant
|
||||
|
||||
@@ -17,16 +18,23 @@ class TestComponentWeblink(unittest.TestCase):
|
||||
"""Stop everything that was started."""
|
||||
self.hass.stop()
|
||||
|
||||
def test_bad_config(self):
|
||||
"""Test if new entity is created."""
|
||||
self.assertFalse(bootstrap.setup_component(self.hass, 'weblink', {
|
||||
'weblink': {
|
||||
'entities': [{}],
|
||||
}
|
||||
}))
|
||||
|
||||
def test_entities_get_created(self):
|
||||
"""Test if new entity is created."""
|
||||
self.assertTrue(weblink.setup(self.hass, {
|
||||
weblink.DOMAIN: {
|
||||
'entities': [
|
||||
{
|
||||
weblink.ATTR_NAME: 'My router',
|
||||
weblink.ATTR_URL: 'http://127.0.0.1/'
|
||||
weblink.CONF_NAME: 'My router',
|
||||
weblink.CONF_URL: 'http://127.0.0.1/'
|
||||
},
|
||||
{}
|
||||
]
|
||||
}
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user