Merge lp:~teknico/charms/precise/juju-gui/1171516-more-backend-tests into lp:~juju-gui/charms/precise/juju-gui/trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 55 | ||||
Proposed branch: | lp:~teknico/charms/precise/juju-gui/1171516-more-backend-tests | ||||
Merge into: | lp:~juju-gui/charms/precise/juju-gui/trunk | ||||
Diff against target: | 0 lines | ||||
To merge this branch: | bzr merge lp:~teknico/charms/precise/juju-gui/1171516-more-backend-tests | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
charmers | Pending | ||
Review via email: mp+162106@code.launchpad.net |
Description of the change
Add more unit tests to the charm backend.
More unit tests for backend properties, commands and methods.
In order to do that, it mangles the charm code pretty heavily:
- it adds module prefixes to all functions imported by backend.py in order to
make them monkeypatchable in tests;
- it renames all sub-backends to mixins, for clarity. Arguably, "backend.mixins
lists all active mixins" is clearer than "backend.backends lists all active
sub-backends, some of which are actual backends and some others are mixins";
- it simplifies the code in a number of places;
- it removes unused or scarcely used code in backend.py, for simplicity;
- it rephrases some docstrings in more specific terms, for readability;
- it removes the overrideable testing framework in backend.py. It imposes a
runtime and complexity cost for doing what is already done in other tests by
monkeypatching;
Further style changes have been moved to a subsequent branch.
It also fixes two import errors.
WARNING: this branch did successfully deploy a stable juju-gui release.
Deploy tests did not run successfully though, and they seem to be broken
in trunk too, right now.
Reviewers: mp+162106_ code.launchpad. net,
Message:
Please take a look.
Description:
Add more unit tests to the charm backend.
More unit tests for backend properties, commands and methods.
In order to do that, it mangles the charm code pretty heavily:
- it adds module prefixes to all functions imported by backend.py in
order to
make them monkeypatchable in tests;
- it renames all sub-backends to mixins, for clarity. Arguably,
"backend.mixins
lists all active mixins" is clearer than "backend.backends lists all
active
sub-backends, some of which are actual backends and some others are
mixins";
- it simplifies the code in a number of places;
- it removes unused or scarcely used code in backend.py, for simplicity;
- it rephrases some docstrings in more specific terms, for readability;
- it removes the overrideable testing framework in backend.py. It
imposes a
runtime and complexity cost for doing what is already done in other
tests by
monkeypatching;
Further style changes have been moved to a subsequent branch.
WARNING: this branch did successfully deploy a stable juju-gui release.
Deploy tests did not run successfully though, and they seem to be broken
in trunk too, right now.
https:/ /code.launchpad .net/~teknico/ charms/ precise/ juju-gui/ 1171516- more-backend- tests/+ merge/162106
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/9121043/
Affected files: backends. py
M .bzrignore
A [revision details]
M hooks/backend.py
M hooks/stop
M hooks/utils.py
M tests/test_
M tests/test_utils.py