Merge ppa-dev-tools:test-create-config into ppa-dev-tools:main
Proposed by
Bryce Harrington
Status: | Merged |
---|---|
Merge reported by: | Bryce Harrington |
Merged at revision: | 6b06eaa91dc8931aea7767a9474a680412a0eff9 |
Proposed branch: | ppa-dev-tools:test-create-config |
Merge into: | ppa-dev-tools:main |
Diff against target: |
275 lines (+97/-27) 4 files modified
ppa/ppa.py (+2/-0) scripts/ppa (+21/-14) tests/helpers.py (+16/-3) tests/test_scripts_ppa.py (+58/-10) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Athos Ribeiro (community) | Approve | ||
Alberto Contreras (community) | Needs Information | ||
Canonical Server Reporter | Pending | ||
Review via email: mp+438274@code.staging.launchpad.net |
Description of the change
This adds unit tests for the create_config() command, which I thought might be a bit superfluous but it did uncover some bad handling of invalid inputs. There's a few other testsuite related fixes and cleanups included.
Best way to test this branch is to run the full testsuite:
$ pytest-3
The current codebase had a test failure relating to processors; this fixes that, and all subsequent commits should likewise pass the full testsuite.
To post a comment you must log in.
There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.
Thanks, Bryce, for adding unit tests. The changes look good.
I have left some nits and two questions / concerns.
1) The main one is the inclusion of the mocking machinery in `Ppa.archive`.
This helps us to unit test the code and it is okay as is.
But, adds new code that it is not needed at runtime and could cause problems in the future. In this case, this is probably an exaggeration, as the modifications are simple and easy to track. But if we establish this pattern of allowing testing code within production code, things could get complicated and bite us at some point.
Have we thought about using other alternatives, as using `pytest.fixtures` and/or `unittests.mock` in the long term? Or are there restrictions to use those that I do not see?
2) The xfail comment.