Make repo error show registry host in CLI

This commit is contained in:
Disassembler 2021-07-11 15:51:48 +02:00
parent 48a08d8fa3
commit 612497abb1
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
2 changed files with 3 additions and 2 deletions

View File

@ -26,7 +26,8 @@ def handle_repo_error(exception):
else:
ex_type = type(exception)
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):
if list_type == 'installed':

View File

@ -40,7 +40,7 @@ def test_handle_app_error(exception, expected, capsys):
spoc_cli.handle_repo_error(exception)
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
@patch('spoc.list_installed', return_value={'anotherapp': '0.1', 'someapp': '0.1'})