Skip to content

Commit

Permalink
Consistent colon usage in FireErrors.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 151593314
Change-Id: I5f91c0cc3445e07fd91e4e16d53b97372949d3c7
Reviewed-on: https://team-review.git.corp.google.com/65736
Reviewed-by: David Bieber <[email protected]>
  • Loading branch information
dbieber committed Mar 29, 2017
1 parent ee1f573 commit 5e65a31
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions fire/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def _Fire(component, args, context, name=None):
break
if not found_target:
error = FireError(
'Cannot find target in dict', target, component)
'Cannot find target in dict:', target, component)
component_trace.AddError(error, initial_args)
return component_trace

Expand Down Expand Up @@ -448,7 +448,7 @@ def _Fire(component, args, context, name=None):

if remaining_args:
component_trace.AddError(
FireError('Could not consume arguments', remaining_args),
FireError('Could not consume arguments:', remaining_args),
initial_args)
return component_trace

Expand Down Expand Up @@ -531,7 +531,7 @@ def _GetMember(component, args):
if arg_name in members:
return members[arg_name], [arg], args[1:]

raise FireError('Could not consume arg', arg)
raise FireError('Could not consume arg:', arg)


def _CallCallable(fn, args):
Expand Down
1 change: 1 addition & 0 deletions fire/test_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def __ne__(self, other):


class EmptyDictOutput(object):

def totally_empty(self):
return {}

Expand Down
3 changes: 2 additions & 1 deletion fire/testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@

class BaseTestCase(unittest.TestCase):
"""Shared test case for Python Fire tests."""

@contextlib.contextmanager
def assertStdoutMatches(self, regexp):
"""Asserts the context generates stdout matching regexp"""
"""Asserts that the context generates stdout matching regexp."""
stdout = six.StringIO()
with mock.patch.object(sys, 'stdout', stdout):
yield
Expand Down

0 comments on commit 5e65a31

Please sign in to comment.