Make repo error show registry host in CLI
This commit is contained in:
parent
48a08d8fa3
commit
612497abb1
@ -26,7 +26,8 @@ def handle_repo_error(exception):
|
|||||||
else:
|
else:
|
||||||
ex_type = type(exception)
|
ex_type = type(exception)
|
||||||
reason = f'{ex_type.__module__}.{ex_type.__name__}'
|
reason = f'{ex_type.__module__}.{ex_type.__name__}'
|
||||||
print(f'Online repository cannot be reached due to: {reason}', file=sys.stderr)
|
print(f'Repository "{spoc.config.REGISTRY_HOST}" cannot be reached due to: {reason}',
|
||||||
|
file=sys.stderr)
|
||||||
|
|
||||||
def listing(list_type):
|
def listing(list_type):
|
||||||
if list_type == 'installed':
|
if list_type == 'installed':
|
||||||
|
@ -40,7 +40,7 @@ def test_handle_app_error(exception, expected, capsys):
|
|||||||
spoc_cli.handle_repo_error(exception)
|
spoc_cli.handle_repo_error(exception)
|
||||||
|
|
||||||
captured = capsys.readouterr()
|
captured = capsys.readouterr()
|
||||||
expected = f'Online repository cannot be reached due to: {expected}\n'
|
expected = f'Repository "{spoc.config.REGISTRY_HOST}" cannot be reached due to: {expected}\n'
|
||||||
assert captured.err == expected
|
assert captured.err == expected
|
||||||
|
|
||||||
@patch('spoc.list_installed', return_value={'anotherapp': '0.1', 'someapp': '0.1'})
|
@patch('spoc.list_installed', return_value={'anotherapp': '0.1', 'someapp': '0.1'})
|
||||||
|
Loading…
Reference in New Issue
Block a user