https://codereview.appspot.com/14669047/diff/1/quickstart/utils.py#newcode58
quickstart/utils.py:58: retcode, output, _ = call('juju', 'switch')
I wonder which is more fragile: relying on a regex of a stdout reply, or
looking at ~/.juju/current-environment and
~/.juju/environments.yaml[default]? This is certainly easier, so I
suppose that's a compelling argument, given that the answer to my
question is not obvious to me.
LGTM with a few trivials. Thank you.
https:/ /codereview. appspot. com/14669047/ diff/1/ Makefile
File Makefile (right):
https:/ /codereview. appspot. com/14669047/ diff/1/ Makefile# newcode20
Makefile:20: JUJU_ENV ?= quickstart
So...this is used by make run to override the normal Python logic of the
command. I'm not quite sure of the value, but I'm fine with it.
https:/ /codereview. appspot. com/14669047/ diff/1/ quickstart/ tests/helpers. py tests/helpers. py (right):
File quickstart/
https:/ /codereview. appspot. com/14669047/ diff/1/ quickstart/ tests/helpers. py#newcode17 tests/helpers. py:17: """Tests helpers for the Juju Quickstart
quickstart/
plugin."""
Trivial: Test helpers
https:/ /codereview. appspot. com/14669047/ diff/1/ quickstart/ tests/test_ manage. py tests/test_ manage. py (right):
File quickstart/
https:/ /codereview. appspot. com/14669047/ diff/1/ quickstart/ tests/test_ manage. py#newcode119 tests/test_ manage. py:119: and a it is also possible to
quickstart/
simulate an arbitrary environment name.
trivial: and it is
https:/ /codereview. appspot. com/14669047/ diff/1/ quickstart/ tests/test_ utils.py tests/test_ utils.py (right):
File quickstart/
https:/ /codereview. appspot. com/14669047/ diff/1/ quickstart/ tests/test_ utils.py# newcode48 tests/test_ utils.py: 48: self.assertEqual(2, retcode)
quickstart/
checking precise non-zero retcode seems a bit risky, even though it
probably is practically fine for something as ancient as ls.
https:/ /codereview. appspot. com/14669047/ diff/1/ quickstart/ tests/test_ utils.py# newcode58 tests/test_ utils.py: 58: self.assertEqua l(127, retcode)
quickstart/
likewise
https:/ /codereview. appspot. com/14669047/ diff/1/ quickstart/ tests/test_ utils.py# newcode112 tests/test_ utils.py: 112: with self.patch_call(0, 'Exterminate! ') as mock_call:
quickstart/
output=
lol
https:/ /codereview. appspot. com/14669047/ diff/1/ quickstart/ utils.py
File quickstart/utils.py (right):
https:/ /codereview. appspot. com/14669047/ diff/1/ quickstart/ utils.py# newcode58 utils.py: 58: retcode, output, _ = call('juju', 'switch') current- environment and environments. yaml[default] ? This is certainly easier, so I
quickstart/
I wonder which is more fragile: relying on a regex of a stdout reply, or
looking at ~/.juju/
~/.juju/
suppose that's a compelling argument, given that the answer to my
question is not obvious to me.
https:/ /codereview. appspot. com/14669047/