Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use voluptuous for Command line platforms #2968

Merged
merged 7 commits into from
Sep 2, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Split setup test
  • Loading branch information
fabaff committed Aug 30, 2016
commit 8e26477e064c51bcad8ed9320617fa6e1a678e22
23 changes: 13 additions & 10 deletions tests/components/notify/test_command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
import os
import tempfile
import unittest
from unittest.mock import patch

import homeassistant.components.notify as notify

from homeassistant.bootstrap import setup_component
from homeassistant import bootstrap
from tests.common import get_test_home_assistant

from unittest.mock import patch


class TestCommandLine(unittest.TestCase):
"""Test the command line notifications."""
Expand All @@ -21,18 +21,21 @@ def tearDown(self): # pylint: disable=invalid-name
"""Stop down everything that was started."""
self.hass.stop()

def test_bad_config(self):
"""Test set up the platform with bad/missing config."""
self.assertFalse(notify.setup(self.hass, {
def test_setup(self):
"""Test setup."""
assert bootstrap.setup_component(self.hass, 'notify', {
'notify': {
'name': 'test',
'platform': 'bad_platform',
}
}))
'platform': 'command_line',
'command': 'echo $(cat); exit 1',
}})

def test_bad_config(self):
"""Test set up the platform with bad/missing configuration."""
self.assertFalse(notify.setup(self.hass, {
'notify': {
'name': 'test',
'platform': 'command_line',
'platform': 'bad_platform',
}
}))

Expand Down