mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 04:50:05 +00:00
Use voluptuous for Command line platforms (#2968)
* Migrate to voluptuous * Fix pylint issues * Remove FIXME * Split setup test * Test with bootstrap * Remove lon and lat * Fix pylint issues
This commit is contained in:
committed by
Teagan Glenn
parent
81628b01c2
commit
40c71b5d96
@@ -2,13 +2,12 @@
|
||||
import os
|
||||
import tempfile
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
import homeassistant.components.notify as notify
|
||||
|
||||
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."""
|
||||
@@ -21,20 +20,23 @@ class TestCommandLine(unittest.TestCase):
|
||||
"""Stop down everything that was started."""
|
||||
self.hass.stop()
|
||||
|
||||
def test_setup(self):
|
||||
"""Test setup."""
|
||||
assert bootstrap.setup_component(self.hass, 'notify', {
|
||||
'notify': {
|
||||
'name': 'test',
|
||||
'platform': 'command_line',
|
||||
'command': 'echo $(cat); exit 1',
|
||||
}})
|
||||
|
||||
def test_bad_config(self):
|
||||
"""Test set up the platform with bad/missing config."""
|
||||
"""Test set up the platform with bad/missing configuration."""
|
||||
self.assertFalse(notify.setup(self.hass, {
|
||||
'notify': {
|
||||
'name': 'test',
|
||||
'platform': 'bad_platform',
|
||||
}
|
||||
}))
|
||||
self.assertFalse(notify.setup(self.hass, {
|
||||
'notify': {
|
||||
'name': 'test',
|
||||
'platform': 'command_line',
|
||||
}
|
||||
}))
|
||||
|
||||
def test_command_line_output(self):
|
||||
"""Test the command line output."""
|
||||
|
||||
Reference in New Issue
Block a user