Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3406)

Issue 6216053: Adds support for --test to cli utils (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 11 months ago by bcsaller
Modified:
11 years, 3 months ago
Reviewers:
mp+106067, hazmat, niemeyer
Visibility:
Public.

Description

Adds support for --test to cli utils This branch bundles two related changes, support for --test on relation-get, unit-get and config-get. This should be similar to the additions made in the golang version. Also this changes to always use a formatter for output and the smart output formatter was changed to YAML dump collection types, normal string values are still printed w/o serialization. https://code.launchpad.net/~bcsaller/juju/sane_output_test_option/+merge/106067 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 4

Patch Set 2 : Adds support for --test to cli utils #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+137 lines, -3 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M juju/hooks/commands.py View 1 8 chunks +37 lines, -3 lines 3 comments Download
M juju/hooks/tests/test_invoker.py View 1 3 chunks +98 lines, -0 lines 1 comment Download

Messages

Total messages: 5
bcsaller
Please take a look.
11 years, 11 months ago (2012-05-16 22:40:34 UTC) #1
niemeyer
Some details here are not clear to me. I'd appreciate having a chat about this ...
11 years, 11 months ago (2012-05-17 02:42:44 UTC) #2
hazmat
bug in base formatter. https://codereview.appspot.com/6216053/diff/1/juju/hooks/cli.py File juju/hooks/cli.py (right): https://codereview.appspot.com/6216053/diff/1/juju/hooks/cli.py#newcode220 juju/hooks/cli.py:220: formatter(result, stream) None is not ...
11 years, 11 months ago (2012-05-18 17:25:47 UTC) #3
bcsaller
Please take a look. https://codereview.appspot.com/6216053/diff/1/juju/hooks/cli.py File juju/hooks/cli.py (right): https://codereview.appspot.com/6216053/diff/1/juju/hooks/cli.py#newcode228 juju/hooks/cli.py:228: # yaml dump container types ...
11 years, 9 months ago (2012-07-06 20:36:07 UTC) #4
hazmat
11 years, 9 months ago (2012-07-10 22:17:19 UTC) #5
I'm still a little unclear as to the desired behavior outcome and its testing
with this branch, as it currently tested it doesn't seem particularly useful.

https://codereview.appspot.com/6216053/diff/6001/juju/hooks/commands.py
File juju/hooks/commands.py (right):

https://codereview.appspot.com/6216053/diff/6001/juju/hooks/commands.py#newco...
juju/hooks/commands.py:18: class TestOptionMixin(object):
missing doc string describing purpose/usage.

https://codereview.appspot.com/6216053/diff/6001/juju/hooks/commands.py#newco...
juju/hooks/commands.py:34: self.handle_test(result)
there's a lot of unesc. method delegation here. just inline the
test_true/handle_test behavior.

The use of the mixin, also feels like its adding complexity here, around
subclass ordering and proper lineage to customize_parser vs. render (which have
inverse call lineages). Incorporating into the base class might be cleaner via
class flag switch.

https://codereview.appspot.com/6216053/diff/6001/juju/hooks/commands.py#newco...
juju/hooks/commands.py:114: def render(self, result):
Why is this returning None, why is it implemented at all? ditto for the two
other implementations of the same here.

https://codereview.appspot.com/6216053/diff/6001/juju/hooks/tests/test_invoke...
File juju/hooks/tests/test_invoker.py (right):

https://codereview.appspot.com/6216053/diff/6001/juju/hooks/tests/test_invoke...
juju/hooks/tests/test_invoker.py:356: 
this is testing something very different then what the cli usage would commonly
be, namely the cli usage would be testing for values unset.

For values set, a null value seems valid, has the go team documented the
behavior of this cli param?
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b