Merge lp:~james-w/launchpad/fix-publishing-getbyid into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Jelmer Vernooij on 2010-06-24 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 11135 |
| Proposed branch: | lp:~james-w/launchpad/fix-publishing-getbyid |
| Merge into: | lp:launchpad |
| Diff against target: |
302 lines (+170/-21) 5 files modified
lib/lp/registry/tests/test_distroseries.py (+1/-1) lib/lp/soyuz/browser/archive.py (+1/-5) lib/lp/soyuz/model/publishing.py (+1/-1) lib/lp/soyuz/tests/test_publishing.py (+59/-2) lib/lp/testing/factory.py (+108/-12) |
| To merge this branch: | bzr merge lp:~james-w/launchpad/fix-publishing-getbyid |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Jelmer Vernooij (community) | code | 2010-06-23 | Approve on 2010-06-24 |
|
Review via email:
|
|||
Commit Message
Fix the API of IPublishingSet.
Description of the Change
Hi,
This fixes IPublishingSet.
usual API. It used to return a ResultSet, now we just call
.one() on it and return None if not found.
We also fix the one caller, which was not using .one() either.
In addition I added a bunch of tests for the method.
In the course of doing that I added some methods to the factory
for binary-type soyuz-stuff that wasn't in the factory before.
It's not complete, but when someone needs the extra arguments
they can add them.
While doing that I made a few cleanups elsewhere to consolidate
code.
Thanks,
James
| Jonathan Lange (jml) wrote : | # |
On Thu, Jun 24, 2010 at 10:40 AM, Jelmer Vernooij <email address hidden> wrote:
...
> I'm bothered by the size of the test factory and its lack of tests. Seeing it extended further worries me a bit, though I don't have any easy alternatives.
I feel guilty about that. The test factory is roughly speaking my
fault. When I made the thing that would later become it, it lacked
tests, since then it has grown incrementally.
jml
| James Westby (james-w) wrote : | # |
> Hi James,
>
> Thanks for the cleanups.
>
> Was changing
> lib/lp/
> intentional ?
No, some make target or something seems to modify it here.
> The class definition of PublishingSetTests needs to be preceded by two empty
> lines.
Changed, thanks.
> There seems to be quite a bit of duplication in the various methods in
> PublishingSetTests, perhaps some of that code could be moved into a setUp()
> method.
Changed, thanks.
> I'm bothered by the size of the test factory and its lack of tests. Seeing it
> extended further worries me a bit, though I don't have any easy alternatives.
It's possible, but tedious to test the factory itself. We could start doing that?
Thanks,
James
| Robert Collins (lifeless) wrote : | # |
Jelmer, the test fixture discussion in bzr may help in terms of giving
you some ideas.
launchpad already has a fixture supporting thing; it might need tweaking.
But basically, rather than one big factory, many small ones, to the
extent of one per thing you want to create, not one to create many
things.
-Rob
| Jelmer Vernooij (jelmer) wrote : | # |
> > I'm bothered by the size of the test factory and its lack of tests. Seeing
> it
> > extended further worries me a bit, though I don't have any easy
> alternatives.
>
> It's possible, but tedious to test the factory itself. We could start doing
> that?
Yeah, it would be nice to do some more testing of the factory, perhaps in preparation of refactoring it into smaller bits as Rob suggests. The success of the test factory and the fact that it's used everywhere will probably make refactoring tedious though...

Hi James,
Thanks for the cleanups.
Was changing soyuz/scripts/ tests/upload_ test_files/ drdsl_1. 2.0.orig. tar.gz intentional ?
lib/lp/
The class definition of PublishingSetTests needs to be preceded by two empty lines.
There seems to be quite a bit of duplication in the various methods in PublishingSetTests, perhaps some of that code could be moved into a setUp() method.
I'm bothered by the size of the test factory and its lack of tests. Seeing it extended further worries me a bit, though I don't have any easy alternatives.