Merge ~bryce/ubuntu-helpers:lp-test-get-show-api-refac into ~ubuntu-server/+git/ubuntu-helpers:main

Proposed by Bryce Harrington
Status: Merged
Merge reported by: Bryce Harrington
Merged at revision: 8c5e6d41059ed0d3cc2307c374b5746ede3de41d
Proposed branch: ~bryce/ubuntu-helpers:lp-test-get-show-api-refac
Merge into: ~ubuntu-server/+git/ubuntu-helpers:main
Diff against target: 321 lines (+84/-79)
2 files modified
.flake8 (+2/-0)
cpaelzer/lp-test-ppa (+82/-79)
Reviewer Review Type Date Requested Status
Athos Ribeiro Approve
Canonical Server Reporter Pending
Canonical Server Pending
Ubuntu Server Pending
Review via email: mp+428428@code.staging.launchpad.net

Description of the change

This significantly refactors the get*() and show*() routines' API to narrow the scope of what they do. This should make unit tests simpler to create, and also makes them work conceptually more like filters. The get*() routines take a urllib request as input, iterates and processes results, and then generates output objects. The show*() routines consume a stream of objects and produce the report to stdout.

Also fixes a bunch of lintian/flake issues related to the above code.

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

LGTM! There is a small nitpick/question inline regarding a docstring.

In the future, using urllib.parse's urlencode and urlunparse may be useful to make it easier to maintain the long urls and parameters.

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

Thanks Athos, incorporated that fix, and thanks for the suggestion on urlencode/urlunparse.

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