Add tests for device CLI skeleton

pull/1052/head
tuxxy 2019-06-07 12:13:48 -06:00
parent 806cced960
commit f107980c25
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
import pytest
from nucypher.cli.main import nucypher_cli
def test_device_cli_backend_errors(click_runner):
with pytest.raises(RuntimeError):
device_args = ('device', 'init')
click_runner.invoke(nucypher_cli, device_args,
catch_exceptions=False)
# TODO: When multiple device support is added, add test to show you can't
# call `nucypher device` with multiple device flags.
device_args = ('device', 'bad arg')
res = click_runner.invoke(nucypher_cli, device_args,
catch_exceptions=False)
assert res.exit_code == 2
def test_device_cli_init_trezor(click_runner, mock_trezorlib):
trezor_init_args = ('device', 'init', '--trezor')
with pytest.raises(NotImplementedError):
click_runner.invoke(nucypher_cli, trezor_init_args,
catch_exceptions=False)