Skip to content

Commit

Permalink
@olasd is expecting this to exit with an error code.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean committed Feb 28, 2014
1 parent 5589ad1 commit 07ade12
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions fedmsg/commands/config.py
Expand Up @@ -92,6 +92,10 @@ def config():

if args.query:
cur = fedmsg.utils.dict_query(cur, args.query)
if cur[args.query] is None:
print >>sys.stderr, (
"Key `%s` does not exist in config" % args.query)
sys.exit(1)

if isinstance(cur, list):
for i in cur:
Expand Down
4 changes: 3 additions & 1 deletion fedmsg/tests/test_commands.py
Expand Up @@ -230,7 +230,9 @@ def test_config_query_broken(self, stderr, stdout, argv):
except SystemExit as exc:
eq_(exc.code, 1)
else:
assert False
output = "output: %r, error: %r" % (
stdout.getvalue(), stderr.getvalue())
assert False, output

output = stdout.getvalue()
error = stderr.getvalue()
Expand Down

0 comments on commit 07ade12

Please sign in to comment.