Merge lp:~mvo/ubuntu/vivid/ubuntu-core-upgrader/add-test-tar-generator into lp:ubuntu/vivid/ubuntu-core-upgrader
Proposed by
Michael Vogt
Status: | Merged |
---|---|
Merged at revision: | 12 |
Proposed branch: | lp:~mvo/ubuntu/vivid/ubuntu-core-upgrader/add-test-tar-generator |
Merge into: | lp:ubuntu/vivid/ubuntu-core-upgrader |
Diff against target: |
226 lines (+112/-85) 2 files modified
ubuntucoreupgrader/tests/test_upgrader.py (+26/-0) ubuntucoreupgrader/upgrader.py (+86/-85) |
To merge this branch: | bzr merge lp:~mvo/ubuntu/vivid/ubuntu-core-upgrader/add-test-tar-generator |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
James Hunt (community) | Approve | ||
Ubuntu branches | Pending | ||
Review via email: mp+251230@code.launchpad.net |
Description of the change
This branch adds a minimal test for the tar_generator() method. With that
in place the other parts of the function (like removed_files handling etc)
can be tested.
I moved the function it out of "Upgrader" because upgrader takes the "options" argument and that caused me some headache to mock. But it does not have to be this way, if we create a MockOptions. But the advantage of having it as a independent function is that all state is explicitly passed in and we don't have to worry about internal object state.
To post a comment you must log in.
Looks good as a start.
As mentioned, unfortunate that we were both working on the same code at the same time, but I can rework my code again to fit in with what we have here. Note that I had solved the options issue by passing a dict of options to the Upgrader() rather than an argparse Namespace() object.