Skip to content

Instantly share code, notes, and snippets.

@peterhoeg
Created December 21, 2018 01:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterhoeg/138ef25d816ae458435d7cec89683d2a to your computer and use it in GitHub Desktop.
Save peterhoeg/138ef25d816ae458435d7cec89683d2a to your computer and use it in GitHub Desktop.
nix-build home-assistant-cli $(pwd)
running install tests
============================= test session starts ==============================
platform linux -- Python 3.7.1, pytest-3.9.3, py-1.7.0, pluggy-0.7.1
rootdir: /build/homeassistant-cli-0.3.0, inifile: setup.cfg
plugins: requests-mock-1.5.2
collected 38 items
tests/test_completion.py ... [ 7%]
tests/test_defaults.py ..... [ 21%]
tests/test_entity.py FFF [ 28%]
tests/test_event.py FFF [ 36%]
tests/test_helper.py .. [ 42%]
tests/test_info.py F... [ 52%]
tests/test_plugins.py ....FF...F.. [ 84%]
tests/test_raw.py .. [ 89%]
tests/test_service.py FF.F [100%]
=================================== FAILURES ===================================
_______________________________ test_entity_list _______________________________
basic_entities_text = '[{\n "attributes": {\n "auto": true,\n "entity_id": [\n "remote.tv"\n ],\n "friendly_na...018-12-05T12:17:52.434229+00:00",\n "last_updated": "2018-12
-05T12:17:52.434229+00:00",\n "state": "off"\n }\n]'
def test_entity_list(basic_entities_text) -> None:
"""Test entities can be listed."""
with requests_mock.Mocker() as mock:
mock.get(
"http://localhost:8123/api/states",
text=basic_entities_text,
status_code=200,
)
runner = CliRunner()
result = runner.invoke(
> cli.cli, ["entity", "list"], catch_exceptions=False
)
tests/test_entity.py:42:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/testing.py:279: in invoke
prog_name=self.get_default_prog_name(cli), **extra)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:697: in main
rv = self.invoke(ctx)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1061: in invoke
cmd_name, cmd, args = self.resolve_command(ctx, args)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1100: in resolve_command
cmd = self.get_command(ctx, cmd_name)
homeassistant_cli/cli.py:90: in get_command
['cli'],
homeassistant_cli/plugins/entity.py:31: in
def get(ctx: Configuration, entity):
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/decorators.py:151: in decorator
_param_memo(f, ArgumentClass(param_decls, **attrs))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = , param_decls = ('entity',)
required = True
attrs = {'autocompletion': }
[581/2464]
def __init__(self, param_decls, required=None, **attrs):
if required is None:
if attrs.get('default') is not None:
required = False
else:
required = attrs.get('nargs', 1) > 0
> Parameter.__init__(self, param_decls, required=required, **attrs)
E TypeError: __init__() got an unexpected keyword argument 'autocompletion'
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1699: TypeError
_______________________________ test_entity_get ________________________________
basic_entities_text = '[{\n "attributes": {\n "auto": true,\n "entity_id": [\n "remote.tv"\n ],\n "friendly_na...018-12-05T12:17:52.434229+00:00",\n "last_updated": "2018-12
-05T12:17:52.434229+00:00",\n "state": "off"\n }\n]'
basic_entities = [{'attributes': {'auto': True, 'entity_id': ['remote.tv'], 'friendly_name': 'friendly long name', 'hidden': True, ...}...f58a02c35408c86e9e34f1d6e141d'}, 'entity_id': 'sensor.three', 'last_
changed': '2018-12-05T12:17:52.434229+00:00', ...}]
def test_entity_get(basic_entities_text, basic_entities) -> None:
"""Test entity get."""
with requests_mock.Mocker() as mock:
sensorone = next(
x for x in basic_entities if x['entity_id'] == 'sensor.one'
)
mock.get(
"http://localhost:8123/api/states/sensor.one",
json=sensorone,
status_code=200,
)
runner = CliRunner()
result = runner.invoke(
> cli.cli, ["entity", "get", "sensor.one"], catch_exceptions=False
)
tests/test_entity.py:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/testing.py:279: in invoke
prog_name=self.get_default_prog_name(cli), **extra)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:697: in main
rv = self.invoke(ctx)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1061: in invoke
cmd_name, cmd, args = self.resolve_command(ctx, args)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1100: in resolve_command
cmd = self.get_command(ctx, cmd_name)
homeassistant_cli/cli.py:90: in get_command
['cli'],
homeassistant_cli/plugins/entity.py:31: in
def get(ctx: Configuration, entity):
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/decorators.py:151: in decorator
_param_memo(f, ArgumentClass(param_decls, **attrs))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = , param_decls = ('entity',)
required = True
attrs = {'autocompletion': }
def __init__(self, param_decls, required=None, **attrs):
if required is None:
if attrs.get('default') is not None:
required = False
else:
required = attrs.get('nargs', 1) > 0
> Parameter.__init__(self, param_decls, required=required, **attrs)
E TypeError: __init__() got an unexpected keyword argument 'autocompletion'
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1699: TypeError
_______________________________ test_entity_edit _______________________________
basic_entities_text = '[{\n "attributes": {\n "auto": true,\n "entity_id": [\n "remote.tv"\n ],\n "friendly_na...018-12-05T12:17:52.434229+00:00",\n "last_updated": "2018-12
-05T12:17:52.434229+00:00",\n "state": "off"\n }\n]'
basic_entities = [{'attributes': {'auto': True, 'entity_id': ['remote.tv'], 'friendly_name': 'friendly long name', 'hidden': True, ...}...f58a02c35408c86e9e34f1d6e141d'}, 'entity_id': 'sensor.three', 'last_
changed': '2018-12-05T12:17:52.434229+00:00', ...}]
def test_entity_edit(basic_entities_text, basic_entities) -> None:
"""Test basic edit of state."""
with requests_mock.Mocker() as mock:
get = mock.get(
"http://localhost:8123/api/states",
text=basic_entities_text,
status_code=200,
)
sensorone = next(
x for x in basic_entities if x['entity_id'] == 'sensor.one'
)
get = mock.get(
"http://localhost:8123/api/states/sensor.one",
json=sensorone,
status_code=200,
)
post = mock.post(
"http://localhost:8123/api/states/sensor.one",
text=EDITED_ENTITY,
status_code=200,
)
runner = CliRunner()
result = runner.invoke(
cli.cli,
["entity", "edit", "sensor.one", "myspecialstate"],
> catch_exceptions=False,
)
tests/test_entity.py:99:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/testing.py:279: in invoke
prog_name=self.get_default_prog_name(cli), **extra)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:697: in main
rv = self.invoke(ctx)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1061: in invoke
cmd_name, cmd, args = self.resolve_command(ctx, args)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1100: in resolve_command
cmd = self.get_command(ctx, cmd_name)
homeassistant_cli/cli.py:90: in get_command
['cli'],
homeassistant_cli/plugins/entity.py:31: in
def get(ctx: Configuration, entity):
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/decorators.py:151: in decorator
_param_memo(f, ArgumentClass(param_decls, **attrs))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ [462/2464]
self = , param_decls = ('entity',)
required = True
attrs = {'autocompletion': }
def __init__(self, param_decls, required=None, **attrs):
if required is None:
if attrs.get('default') is not None:
required = False
else:
required = attrs.get('nargs', 1) > 0
> Parameter.__init__(self, param_decls, required=required, **attrs)
E TypeError: __init__() got an unexpected keyword argument 'autocompletion'
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1699: TypeError
_______________________________ test_entity_list _______________________________
def test_entity_list():
"""Test entities can be listed."""
with requests_mock.Mocker() as mock:
mock.get(
"http://localhost:8123/api/states",
text=VALID_INFO,
status_code=200,
)
runner = CliRunner()
result = runner.invoke(
> cli.cli, ["entity", "list"], catch_exceptions=False
)
tests/test_event.py:115:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/testing.py:279: in invoke
prog_name=self.get_default_prog_name(cli), **extra)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:697: in main
rv = self.invoke(ctx)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1061: in invoke
cmd_name, cmd, args = self.resolve_command(ctx, args)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1100: in resolve_command
cmd = self.get_command(ctx, cmd_name)
homeassistant_cli/cli.py:90: in get_command
['cli'],
homeassistant_cli/plugins/entity.py:31: in
def get(ctx: Configuration, entity):
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/decorators.py:151: in decorator
_param_memo(f, ArgumentClass(param_decls, **attrs))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = , param_decls = ('entity',)
required = True
attrs = {'autocompletion': }
def __init__(self, param_decls, required=None, **attrs):
if required is None:
if attrs.get('default') is not None:
required = False
else:
required = attrs.get('nargs', 1) > 0
> Parameter.__init__(self, param_decls, required=required, **attrs) [402/2464]
E TypeError: __init__() got an unexpected keyword argument 'autocompletion'
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1699: TypeError
_______________________________ test_entity_get ________________________________
def test_entity_get() -> None:
"""Test basic get of entity."""
with requests_mock.Mocker() as mock:
mock.get(
re.compile("http://localhost:8123/api/states"),
text=SINGLE_ENTITY,
status_code=200,
)
runner = CliRunner()
result = runner.invoke(
cli.cli,
["entity", "get", "group.all_remotes"],
> catch_exceptions=False,
)
tests/test_event.py:136:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/testing.py:279: in invoke
prog_name=self.get_default_prog_name(cli), **extra)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:697: in main
rv = self.invoke(ctx)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1061: in invoke
cmd_name, cmd, args = self.resolve_command(ctx, args)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1100: in resolve_command
cmd = self.get_command(ctx, cmd_name)
homeassistant_cli/cli.py:90: in get_command
['cli'],
homeassistant_cli/plugins/entity.py:31: in
def get(ctx: Configuration, entity):
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/decorators.py:151: in decorator
_param_memo(f, ArgumentClass(param_decls, **attrs))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = , param_decls = ('entity',)
required = True
attrs = {'autocompletion': }
def __init__(self, param_decls, required=None, **attrs):
if required is None:
if attrs.get('default') is not None:
required = False
else:
required = attrs.get('nargs', 1) > 0
> Parameter.__init__(self, param_decls, required=required, **attrs)
E TypeError: __init__() got an unexpected keyword argument 'autocompletion'
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1699: TypeError
_______________________________ test_entity_edit _______________________________
def test_entity_edit():
"""Test basic edit of state."""
with requests_mock.Mocker() as mock:
get = mock.get(
re.compile("http://localhost:8123/api/states"),
text=SINGLE_ENTITY,
status_code=200,
)
post = mock.post(
re.compile("http://localhost:8123/api/states"),
text=EDITED_ENTITY,
status_code=200,
)
runner = CliRunner()
result = runner.invoke(
cli.cli,
["entity", "edit", "group.all_remotes", "myspecialstate"],
> catch_exceptions=False,
)
tests/test_event.py:162:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/testing.py:279: in invoke
prog_name=self.get_default_prog_name(cli), **extra)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:697: in main
rv = self.invoke(ctx)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1061: in invoke
cmd_name, cmd, args = self.resolve_command(ctx, args)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1100: in resolve_command
cmd = self.get_command(ctx, cmd_name)
homeassistant_cli/cli.py:90: in get_command
['cli'],
homeassistant_cli/plugins/entity.py:31: in
def get(ctx: Configuration, entity):
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/decorators.py:151: in decorator
_param_memo(f, ArgumentClass(param_decls, **attrs))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = , param_decls = ('entity',)
required = True
attrs = {'autocompletion': }
def __init__(self, param_decls, required=None, **attrs):
if required is None:
if attrs.get('default') is not None:
required = False
else:
required = attrs.get('nargs', 1) > 0
> Parameter.__init__(self, param_decls, required=required, **attrs)
E TypeError: __init__() got an unexpected keyword argument 'autocompletion'
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1699: TypeError
_______________________ test_info_without_server_running _______________________
def test_info_without_server_running() -> None:
"""Test proper failure when server not running."""
runner = CliRunner()
result = runner.invoke(
cli.cli, ['--server', 'http://donotexist.inf', 'info']
)
> assert result.exit_code == 1
E AssertionError: assert -1 == 1
E + where -1 = .exit_code [283/2464]
tests/test_info.py:35: AssertionError
_________________________ test_commands_loads[entity] __________________________
plugin = 'entity'
@pytest.mark.parametrize("plugin", DFEAULT_PLUGINS)
def test_commands_loads(plugin) -> None:
"""Test plugin discovery."""
hac = HomeAssistantCli()
ctx = cli.make_context('hass-cli', ['info'])
> cmd = hac.get_command(ctx, plugin)
tests/test_plugins.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
homeassistant_cli/cli.py:90: in get_command
['cli'],
homeassistant_cli/plugins/entity.py:31: in
def get(ctx: Configuration, entity):
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/decorators.py:151: in decorator
_param_memo(f, ArgumentClass(param_decls, **attrs))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = , param_decls = ('entity',)
required = True
attrs = {'autocompletion': }
def __init__(self, param_decls, required=None, **attrs):
if required is None:
if attrs.get('default') is not None:
required = False
else:
required = attrs.get('nargs', 1) > 0
> Parameter.__init__(self, param_decls, required=required, **attrs)
E TypeError: __init__() got an unexpected keyword argument 'autocompletion'
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1699: TypeError
__________________________ test_commands_loads[event] __________________________
plugin = 'event'
@pytest.mark.parametrize("plugin", DFEAULT_PLUGINS)
def test_commands_loads(plugin) -> None:
"""Test plugin discovery."""
hac = HomeAssistantCli()
ctx = cli.make_context('hass-cli', ['info'])
> cmd = hac.get_command(ctx, plugin)
tests/test_plugins.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
homeassistant_cli/cli.py:90: in get_command
['cli'],
homeassistant_cli/plugins/event.py:32: in
def fire(ctx: Configuration, event, json):
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/decorators.py:151: in decorator [224/2464]
_param_memo(f, ArgumentClass(param_decls, **attrs))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = , param_decls = ('event',)
required = True, attrs = {'autocompletion': }
def __init__(self, param_decls, required=None, **attrs):
if required is None:
if attrs.get('default') is not None:
required = False
else:
required = attrs.get('nargs', 1) > 0
> Parameter.__init__(self, param_decls, required=required, **attrs)
E TypeError: __init__() got an unexpected keyword argument 'autocompletion'
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1699: TypeError
_________________________ test_commands_loads[service] _________________________
plugin = 'service'
@pytest.mark.parametrize("plugin", DFEAULT_PLUGINS)
def test_commands_loads(plugin) -> None:
"""Test plugin discovery."""
hac = HomeAssistantCli()
ctx = cli.make_context('hass-cli', ['info'])
> cmd = hac.get_command(ctx, plugin)
tests/test_plugins.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
homeassistant_cli/cli.py:90: in get_command
['cli'],
homeassistant_cli/plugins/service.py:66: in
def call(ctx: Configuration, service, arguments):
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/decorators.py:151: in decorator
_param_memo(f, ArgumentClass(param_decls, **attrs))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self =
param_decls = ('service',), required = True
attrs = {'autocompletion': }
def __init__(self, param_decls, required=None, **attrs):
if required is None:
if attrs.get('default') is not None:
required = False
else:
required = attrs.get('nargs', 1) > 0
> Parameter.__init__(self, param_decls, required=required, **attrs)
E TypeError: __init__() got an unexpected keyword argument 'autocompletion'
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1699: TypeError
______________________________ test_service_list _______________________________
default_services = [{'domain': 'homeassistant', 'services': {'check_config': {'description': 'Check the Home Assistant configuration file...'timer.timer0'}}}}}, {'domain': 'shell_command', 'services': {'lov
elace_gen': {'description': '', 'fields': {}}}}, ...]
def test_service_list(default_services) -> None:
"""Test services can be listed.""" [164/2464]
with requests_mock.Mocker() as mock:
mock.get(
"http://localhost:8123/api/services",
json=default_services,
status_code=200,
)
runner = CliRunner()
result = runner.invoke(
> cli.cli, ["service", "list"], catch_exceptions=False
)
tests/test_service.py:22:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/testing.py:279: in invoke
prog_name=self.get_default_prog_name(cli), **extra)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:697: in main
rv = self.invoke(ctx)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1061: in invoke
cmd_name, cmd, args = self.resolve_command(ctx, args)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1100: in resolve_command
cmd = self.get_command(ctx, cmd_name)
homeassistant_cli/cli.py:90: in get_command
['cli'],
homeassistant_cli/plugins/service.py:66: in
def call(ctx: Configuration, service, arguments):
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/decorators.py:151: in decorator
_param_memo(f, ArgumentClass(param_decls, **attrs))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self =
param_decls = ('service',), required = True
attrs = {'autocompletion': }
def __init__(self, param_decls, required=None, **attrs):
if required is None:
if attrs.get('default') is not None:
required = False
else:
required = attrs.get('nargs', 1) > 0
> Parameter.__init__(self, param_decls, required=required, **attrs)
E TypeError: __init__() got an unexpected keyword argument 'autocompletion'
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1699: TypeError
_____________________________ test_service_filter ______________________________
default_services = [{'domain': 'homeassistant', 'services': {'check_config': {'description': 'Check the Home Assistant configuration file...'timer.timer0'}}}}}, {'domain': 'shell_command', 'services': {'lov
elace_gen': {'description': '', 'fields': {}}}}, ...]
def test_service_filter(default_services) -> None:
"""Test services can be listed."""
with requests_mock.Mocker() as mock:
mock.get(
"http://localhost:8123/api/services",
json=default_services,
status_code=200,
)
runner = CliRunner()
result = runner.invoke( [104/2464]
cli.cli,
["service", "list", "homeassistant\\.turn.*"],
> catch_exceptions=False,
)
tests/test_service.py:42:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/testing.py:279: in invoke
prog_name=self.get_default_prog_name(cli), **extra)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:697: in main
rv = self.invoke(ctx)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1061: in invoke
cmd_name, cmd, args = self.resolve_command(ctx, args)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1100: in resolve_command
cmd = self.get_command(ctx, cmd_name)
homeassistant_cli/cli.py:90: in get_command
['cli'],
homeassistant_cli/plugins/service.py:66: in
def call(ctx: Configuration, service, arguments):
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/decorators.py:151: in decorator
_param_memo(f, ArgumentClass(param_decls, **attrs))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self =
param_decls = ('service',), required = True
attrs = {'autocompletion': }
def __init__(self, param_decls, required=None, **attrs):
if required is None:
if attrs.get('default') is not None:
required = False
else:
required = attrs.get('nargs', 1) > 0
> Parameter.__init__(self, param_decls, required=required, **attrs)
E TypeError: __init__() got an unexpected keyword argument 'autocompletion'
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1699: TypeError
______________________________ test_service_call _______________________________
default_services = [{'domain': 'homeassistant', 'services': {'check_config': {'description': 'Check the Home Assistant configuration file...'timer.timer0'}}}}}, {'domain': 'shell_command', 'services': {'lov
elace_gen': {'description': '', 'fields': {}}}}, ...]
def test_service_call(default_services) -> None:
"""Test basic call of a service."""
with requests_mock.Mocker() as mock:
post = mock.post(
"http://localhost:8123/api/services/homeassistant/restart",
json={"result": "bogus"},
status_code=200,
)
runner = CliRunner()
result = runner.invoke(
cli.cli,
["service", "call", "homeassistant.restart"],
> catch_exceptions=False,
)
tests/test_service.py:85:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/testing.py:279: in invoke
prog_name=self.get_default_prog_name(cli), **extra)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:697: in main
rv = self.invoke(ctx)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1061: in invoke
cmd_name, cmd, args = self.resolve_command(ctx, args)
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1100: in resolve_command
cmd = self.get_command(ctx, cmd_name)
homeassistant_cli/cli.py:90: in get_command
['cli'],
homeassistant_cli/plugins/service.py:66: in
def call(ctx: Configuration, service, arguments):
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/decorators.py:151: in decorator
_param_memo(f, ArgumentClass(param_decls, **attrs))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self =
param_decls = ('service',), required = True
attrs = {'autocompletion': }
def __init__(self, param_decls, required=None, **attrs):
if required is None:
if attrs.get('default') is not None:
required = False
else:
required = attrs.get('nargs', 1) > 0
> Parameter.__init__(self, param_decls, required=required, **attrs)
E TypeError: __init__() got an unexpected keyword argument 'autocompletion'
/nix/store/xla5gpinvymhc2qsb4jf13f7z5i4vyzy-python3.7-click-6.7/lib/python3.7/site-packages/click/core.py:1699: TypeError
=============================== warnings summary ===============================
/nix/store/lh7vslg4jlrmkrm8r65zfddggfd72ndg-python3.7-tabulate-0.8.2/lib/python3.7/site-packages/tabulate.py:7
/nix/store/lh7vslg4jlrmkrm8r65zfddggfd72ndg-python3.7-tabulate-0.8.2/lib/python3.7/site-packages/tabulate.py:7: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collecti
ons.abc' is deprecated, and in 3.8 it will stop working
from collections import namedtuple, Iterable
tests/test_entity.py::test_entity_list
source:1259: DeprecationWarning: invalid escape sequence \s
source:111: DeprecationWarning: invalid escape sequence \s
tests/test_entity.py::test_entity_get
source:1259: DeprecationWarning: invalid escape sequence \s
source:111: DeprecationWarning: invalid escape sequence \s
tests/test_entity.py::test_entity_edit
source:1259: DeprecationWarning: invalid escape sequence \s
source:111: DeprecationWarning: invalid escape sequence \s
tests/test_event.py::test_entity_list
source:1259: DeprecationWarning: invalid escape sequence \s
source:111: DeprecationWarning: invalid escape sequence \s
tests/test_event.py::test_entity_get
source:1259: DeprecationWarning: invalid escape sequence \s
source:111: DeprecationWarning: invalid escape sequence \s
tests/test_event.py::test_entity_edit
source:1259: DeprecationWarning: invalid escape sequence \s
source:111: DeprecationWarning: invalid escape sequence \s
tests/test_info.py::test_info_yaml
/nix/store/16m1my18igzqg34v06p3sx7ah423fy3f-python3.7-PyYAML-3.13/lib/python3.7/site-packages/yaml/constructor.py:126: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'c
ollections.abc' is deprecated, and in 3.8 it will stop working
if not isinstance(key, collections.Hashable):
tests/test_plugins.py::test_commands_loads[entity]
source:111: DeprecationWarning: invalid escape sequence \s
source:1259: DeprecationWarning: invalid escape sequence \s
tests/test_plugins.py::test_commands_loads[event]
source:111: DeprecationWarning: invalid escape sequence \s
source:1259: DeprecationWarning: invalid escape sequence \s
tests/test_plugins.py::test_commands_loads[service]
source:111: DeprecationWarning: invalid escape sequence \s
source:1259: DeprecationWarning: invalid escape sequence \s
tests/test_plugins.py::test_commands_loads[template]
/nix/store/4ps5h54vwgpxs71w6qqvwrrb9bcbkc1j-python3.7-Jinja2-2.10/lib/python3.7/site-packages/jinja2/utils.py:485: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'colle
ctions.abc' is deprecated, and in 3.8 it will stop working
from collections import MutableMapping
/nix/store/gnzwkzwmjq4xz19xp7605bm8jp8vb6m3-python3.7-MarkupSafe-1.0/lib/python3.7/site-packages/markupsafe/__init__.py:13: DeprecationWarning: Using or importing the ABCs from 'collections' instead of fr
om 'collections.abc' is deprecated, and in 3.8 it will stop working
from collections import Mapping
tests/test_service.py::test_service_list
source:1259: DeprecationWarning: invalid escape sequence \s
source:111: DeprecationWarning: invalid escape sequence \s
tests/test_service.py::test_service_filter
source:1259: DeprecationWarning: invalid escape sequence \s
source:111: DeprecationWarning: invalid escape sequence \s
tests/test_service.py::test_service_call
source:1259: DeprecationWarning: invalid escape sequence \s
source:111: DeprecationWarning: invalid escape sequence \s
-- Docs: https://docs.pytest.org/en/latest/warnings.html
============== 13 failed, 25 passed, 28 warnings in 1.14 seconds ===============
builder for '/nix/store/9nkfbprnma0f8wvckav06dyz3347fsbj-homeassistant-cli-0.3.0.drv' failed with exit code 1
error: build of '/nix/store/9nkfbprnma0f8wvckav06dyz3347fsbj-homeassistant-cli-0.3.0.drv' failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment