Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message logging on exit #592

Merged
merged 14 commits into from
Jun 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion integration_tests/test_snap.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test_error_with_unexistent_build_package(self):
subprocess.CalledProcessError, self.run_snapcraft, 'snap')
expected = (
"Could not find a required package in 'build-packages': "
'"The cache has\nno package named \'inexistent-package\'"\n')
'"The cache has no package named \'inexistent-package\'"\n')
self.assertEqual(expected, exception.output)

def test_snap_with_exposed_files(self):
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/test_stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ def test_conflicts(self):
self.assertEqual(1, exception.returncode)
expected = (
"Parts 'p1' and 'p2' have the following file paths in common "
"which have\ndifferent contents: bin/test\n")
"which have different contents:\nbin/test\n")
self.assertThat(exception.output, EndsWith(expected))
3 changes: 1 addition & 2 deletions snapcraft/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@
import pkgutil
import shutil
import sys
import textwrap

from docopt import docopt

Expand Down Expand Up @@ -205,7 +204,7 @@ def main(argv=None):
if args['--debug']:
raise

logger.error(textwrap.fill(str(e)))
logger.error(str(e))
sys.exit(1)


Expand Down
8 changes: 4 additions & 4 deletions snapcraft/tests/test_commands_cleanbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def test_no_lxd(self, mock_installed):
self.assertEqual(
fake_logger.output,
'The lxd package is not installed, in order to use `cleanbuild` '
'you\nmust install lxd onto your system. Refer to the '
'"Ubuntu Desktop and\nUbuntu Server" section on '
'https://linuxcontainers.org/lxd/getting-\nstarted-cli/'
'#ubuntu-desktop-and-ubuntu-server to enable a proper\nsetup.\n')
'you must install lxd onto your system. Refer to the '
'"Ubuntu Desktop and Ubuntu Server" section on '
'https://linuxcontainers.org/lxd/getting-started-cli/'
'#ubuntu-desktop-and-ubuntu-server to enable a proper setup.\n')
2 changes: 1 addition & 1 deletion snapcraft/tests/test_commands_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_topic_and_plugin_not_found_exits_with_tip(self):
self.assertEqual(
fake_logger.output,
'The plugin does not exist. Run `snapcraft '
'list-plugins` to see the\navailable plugins.\n')
'list-plugins` to see the available plugins.\n')

@mock.patch('sys.stdout', new_callable=io.StringIO)
def test_print_module_help_when_no_help_for_valid_plugin(
Expand Down