mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 09:47:52 +00:00
Restructured conversation tests.
This commit is contained in:
parent
364d85b6df
commit
7dd7d7a191
@ -29,8 +29,22 @@ class TestConversation(unittest.TestCase):
|
||||
""" Stop down stuff we started. """
|
||||
self.hass.stop()
|
||||
|
||||
def test_setup_and_good_requests(self):
|
||||
""" Setup and perform good requests """
|
||||
def test_setup_and_turn_on(self):
|
||||
""" Setup and perform good turn on requests """
|
||||
self.assertTrue(
|
||||
conversation.setup(self.hass, {conversation.DOMAIN: {}}))
|
||||
|
||||
light.turn_off(self.hass, '{}.kitchen'.format(light.DOMAIN))
|
||||
|
||||
event_data = {conversation.ATTR_TEXT: 'turn kitchen on'}
|
||||
self.hass.services.call(
|
||||
conversation.DOMAIN, 'process', event_data, True)
|
||||
|
||||
self.assertTrue(
|
||||
light.is_on(self.hass, '{}.kitchen'.format(light.DOMAIN)))
|
||||
|
||||
def test_setup_and_turn_off(self):
|
||||
""" Setup and perform good turn off requests """
|
||||
self.assertTrue(
|
||||
conversation.setup(self.hass, {conversation.DOMAIN: {}}))
|
||||
|
||||
@ -43,13 +57,6 @@ class TestConversation(unittest.TestCase):
|
||||
self.assertFalse(
|
||||
light.is_on(self.hass, '{}.kitchen'.format(light.DOMAIN)))
|
||||
|
||||
event_data = {conversation.ATTR_TEXT: 'turn kitchen on'}
|
||||
self.hass.services.call(
|
||||
conversation.DOMAIN, 'process', event_data, True)
|
||||
|
||||
self.assertTrue(
|
||||
light.is_on(self.hass, '{}.kitchen'.format(light.DOMAIN)))
|
||||
|
||||
def test_setup_and_bad_request_format(self):
|
||||
""" Setup and perform a badly formatted request """
|
||||
self.assertTrue(
|
||||
|
Loading…
x
Reference in New Issue
Block a user