Frontier silicon (#6131)
* added frontier_silicon constant * added the frontier_silicon component * cleaning up according to travis * trying to satisfy pylint * trying to satisfy pylint * fsapi version 0.0.6 * with fsapi version 0.0.7 * added fsapi dependency * yielding the FSAPI * Removing white space from docstring * Removing white space from an empty line * Switching to sync * clean up white spaces and rename device to FSAPIDevice * added frontier_silicon constant * added the frontier_silicon component * cleaning up according to travis * trying to satisfy pylint * trying to satisfy pylint * fsapi version 0.0.6 * with fsapi version 0.0.7 * added fsapi dependency * yielding the FSAPI * Removing white space from docstring * Removing white space from an empty line * Switching to sync * clean up white spaces and rename device to FSAPIDevice * changed info to debug * added frontier_silicon constant * added the frontier_silicon component * cleaning up according to travis * trying to satisfy pylint * trying to satisfy pylint * fsapi version 0.0.6 * with fsapi version 0.0.7 * added fsapi dependency * yielding the FSAPI * Removing white space from docstring * Removing white space from an empty line * Switching to sync * clean up white spaces and rename device to FSAPIDevice * added the frontier_silicon component * trying to satisfy pylint * fsapi version 0.0.6 * remove white space * generated requirements * added the frontier_silicon component * cleaning up according to travis * trying to satisfy pylint * trying to satisfy pylint * fsapi version 0.0.6 * with fsapi version 0.0.7 * added fsapi dependency * yielding the FSAPI * Removing white space from docstring * Removing white space from an empty line * Switching to sync * clean up white spaces and rename device to FSAPIDevice * trying to satisfy pylint * changed info to debug * added the frontier_silicon component * fsapi version 0.0.6 * generated requirements * pylint * moved import requests to the method where it is being used * add a basic unit test * cleaned up source code * added frontier_silicon constant * added the frontier_silicon component * added basic test * added fsapi to requirements_all.txt * added coverage omit, though a basic test was included * added MEDIA_TYPE_MUSIC for artist and album * removed duplicate cons * switched fsapi call to a property, removed unecessary comment * detailed docstring for fs_device * added a space for the info_name - info_text separator * reduced proeprty (fsapi) access for volume down/up
This commit is contained in:
1 parent
aa1f64bed6
commit
be297c4c7e
5 files changed
+299
No files matched your search
@@ -0,0 +1,42 @@
|
||||
"""The tests for the Demo Media player platform."""
|
||||
import unittest
|
||||
from unittest import mock
|
||||
|
||||
import logging
|
||||
|
||||
from homeassistant.components.media_player.frontier_silicon import FSAPIDevice
|
||||
from homeassistant.components.media_player import frontier_silicon
|
||||
from homeassistant import const
|
||||
|
||||
from tests.common import get_test_home_assistant
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class TestFrontierSiliconMediaPlayer(unittest.TestCase):
|
||||
"""Test the media_player module."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
def tearDown(self): # pylint: disable=invalid-name
|
||||
"""Stop everything that was started."""
|
||||
self.hass.stop()
|
||||
|
||||
def test_host_required_with_host(self):
|
||||
"""Test that a host with a valid url is set when using a conf."""
|
||||
fake_config = {
|
||||
const.CONF_HOST: 'host_ip',
|
||||
}
|
||||
result = frontier_silicon.setup_platform(self.hass,
|
||||
fake_config, mock.MagicMock())
|
||||
|
||||
self.assertTrue(result)
|
||||
|
||||
def test_invalid_host(self):
|
||||
"""Test that a host with a valid url is set when using a conf."""
|
||||
import requests
|
||||
|
||||
fsapi = FSAPIDevice('INVALID_URL', '1234')
|
||||
self.assertRaises(requests.exceptions.MissingSchema, fsapi.update)
|
||||
Reference in new issue
Block a user