Merge lp://staging/~jtv/launchpad/bug-632880 into lp://staging/launchpad
Status: | Merged |
---|---|
Approved by: | Robert Collins |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11526 |
Proposed branch: | lp://staging/~jtv/launchpad/bug-632880 |
Merge into: | lp://staging/launchpad |
Diff against target: |
622 lines (+223/-111) 6 files modified
lib/canonical/launchpad/database/librarian.py (+1/-1) lib/canonical/librarian/client.py (+120/-58) lib/canonical/librarian/ftests/test_web.py (+35/-29) lib/canonical/librarian/interfaces.py (+9/-0) lib/lp/testing/fakelibrarian.py (+7/-2) lib/lp/testing/tests/test_fakelibrarian.py (+51/-21) |
To merge this branch: | bzr merge lp://staging/~jtv/launchpad/bug-632880 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Steve Kowalik (community) | code* | Abstain | |
Robert Collins (community) | Approve | ||
Review via email: mp+34961@code.staging.launchpad.net |
Commit message
Generate URLs straight from LibraryFileAlias.
Description of the change
= Bug 632880 =
This fixes a small and subtle problem in working with the Librarian. When we render links to persons, products, and so on, we include any icons that may have been set for them. The link formatter gets the LibraryFileAlias for each icon, and gets its URL.
Under the hood, the LibraryFileAlias delegates this work to the LibrarianDownlo
In this branch I make retrieval of URLs work directly from the LibraryFileAlias object. This would be bad if there were a thread or process boundary between the point where the LibraryFileAlias is retrieved and where it's used, but that is not the case here.
A lot of the work is actually in making sure that the FakeLibrarian supports the new method, and that it stays equivalent to the one in the real Librarian.
To test:
{{{
./bin/test -vvc canonical.
./bin/test -vvc lp.testing.
}}}
There's plenty of lint, I'm sorry to say, though none that I introduced. I'ld be happy to clean it up, but did not want to pollute the diff for the review.
Jeroen
A conflicting change came in after I put this up for review. It added a fair amount of lint, which I hope I've mostly cleaned up. Unfortunately the combination with my refactorings makes the diff hard to read: I extracted a few clear units of functionality into their own methods, but the diff tends to show this as a renamed method with confusing changes.