Skip to content

Commit

Permalink
Applied sergio's suggestions.
Browse files Browse the repository at this point in the history
  • Loading branch information
come-maiz committed Jun 15, 2016
1 parent 5d4dcb3 commit 1245fd5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions snaps_tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __init__(self, command, working_dir, message):
self.message = message

def __str__(self):
return 'Error running command {} in {}. {}'.format(
return 'Error running command {!r} in {!r}. {}'.format(
self.command, self.working_dir, self.message)


Expand Down Expand Up @@ -111,7 +111,7 @@ def setUp(self):
self.skipTest(
'{} does not match the filter {}'.format(
self.snap_content_dir, filter_))
logger.info('Testing ' + self.snap_content_dir)
logger.info('Testing {}'.format(self.snap_content_dir))
super().setUp()
if os.getenv('SNAPCRAFT_FROM_INSTALLED', False):
self.snapcraft_command = 'snapcraft'
Expand Down Expand Up @@ -158,11 +158,11 @@ def build_snap(self, snap_content_dir):
self._snap(working_dir)

def _clean(self, project_dir):
command = self.snapcraft_command + ' clean'
command = '{} {}'.format(self.snapcraft_command, 'clean')
self._run_command(command, project_dir)

def _snap(self, project_dir):
command = self.snapcraft_command + ' snap'
command = '{} {}'.format(self.snapcraft_command, 'snap')
self._run_command(
command, project_dir, expect='Snapped .*\.snap', timeout=1200)

Expand All @@ -178,14 +178,14 @@ def _run_command(
self._add_output_detail(process.before)
raise CommandError(
command, working_dir,
'Expected output "{}" not found.'.format(expect)) from None
'Expected output {!r} not found.'.format(expect)) from None
finally:
process.close()
if process.exitstatus:
self._add_output_detail(process.before)
raise CommandError(
command, working_dir,
'Exit status: {}.'.format(process.exitstatus))
'Exit status: {!r}.'.format(process.exitstatus))

def _add_output_detail(self, output):
self.addDetail('output', content.text_content(str(output)))
Expand Down

0 comments on commit 1245fd5

Please sign in to comment.