Merge ppa-dev-tools:set-command-basic-unittests into ppa-dev-tools:main

Proposed by Bryce Harrington
Status: Merged
Merged at revision: 62203735c8f705687711c2a18a54d3b4bd5d9131
Proposed branch: ppa-dev-tools:set-command-basic-unittests
Merge into: ppa-dev-tools:main
Diff against target: 222 lines (+100/-15)
4 files modified
ppa/ppa.py (+11/-0)
scripts/ppa (+20/-2)
tests/helpers.py (+5/-2)
tests/test_scripts_ppa.py (+64/-11)
Reviewer Review Type Date Requested Status
Athos Ribeiro (community) Approve
Canonical Server Pending
Canonical Server Reporter Pending
Review via email: mp+439454@code.staging.launchpad.net

Description of the change

Adds support for enabling and disabling publishing. Not entirely sure why one would want to change this setting, but it's a simple boolean so is easy to implement.

But the actual main thrust of this branch is to improve the testing for the create and set commands, the --publish option just serves as a useful case for testing. The unit tests go beyond just checking the argument handling itself, to verify the changes get passed down to the (mock) launchpad PPA object.

In doing this I discovered that my earlier fixup for the ArchiveMock class was incorrect; it happened to work then just because we weren't really using it for anything notable. With the expanded tests for the set command, the error became apparent. This branch corrects that by monkeypatching the PersonMock class to setup the ArchiveMock during creation (as suggested by one of the reviewers of the previous code IIRC).

To post a comment you must log in.
Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Nice work, Bryce! LGTM

review: Approve
Revision history for this message
Bryce Harrington (bryce) wrote :

Thanks, landed.

Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
To git+ssh://git.launchpad.net/ppa-dev-tools
   bad3b8b..6220373 main -> main

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: