Merge lp://qastaging/~james-w/launchpad/more-matchers into lp://qastaging/launchpad

Proposed by James Westby
Status: Work in progress
Proposed branch: lp://qastaging/~james-w/launchpad/more-matchers
Merge into: lp://qastaging/launchpad
Prerequisite: lp://qastaging/~james-w/launchpad/improve-makeDistroArchSeries
Diff against target: 745 lines (+559/-31)
7 files modified
lib/lp/soyuz/testing/matchers.py (+137/-0)
lib/lp/soyuz/testing/tests/test_matchers.py (+244/-0)
lib/lp/soyuz/tests/test_publishing.py (+7/-24)
lib/lp/testing/factory.py (+1/-1)
lib/lp/testing/matchers.py (+61/-3)
lib/lp/testing/tests/test_factory.py (+10/-0)
lib/lp/testing/tests/test_matchers.py (+99/-3)
To merge this branch: bzr merge lp://qastaging/~james-w/launchpad/more-matchers
Reviewer Review Type Date Requested Status
Robert Collins (community) Approve
Review via email: mp+32057@code.qastaging.launchpad.net

Commit message

[r=lifeless][no-qa] Add some more matchers, particularly soyuz-specific ones.

Description of the change

Hi,

This ports some Soyuz custom assertion methods to matchers.

I did this so that tests can make use of them without having to
subclass what is a fairly heavyweight test class.

I could have added a new TestCase subclass with the custom assertion
methods only and slotted it in to the existing hierarchy, but matchers
are better.

Lint:

./lib/lp/testing/factory.py
      32: redefinition of unused 'os' from line 31

Thanks,

James

To post a comment you must log in.
11332. By James Westby

Dummy revision to force diff regeneration.

11333. By James Westby

Fix the docstrings given that it's not publications that superseded publications.

Revision history for this message
Robert Collins (lifeless) wrote :

PublishedStateIsNot is a little weird to export, being a mismatch - might want to think about the clarity for users there.

PublishedStateIs would add more debug value if it included all the failing elements, not just the first.

Typo 'supecseded'

This could be a regular method, not inline.
+ def spr_title(spr):

DateIsInPast would be good to do upstream - its not launchpad domain specific at all.

Please consider these tweaks and recommendations.

review: Approve
11334. By James Westby

Rename PublishedStateIsNot to PublishedStateIsWrong as the first sounds like a matcher.

11335. By James Westby

Use a normal function, not an inline one for title_of.

11336. By James Westby

Fix matcher import.

11337. By James Westby

Allow publishing records in the superseded check.

Revision history for this message
Graham Binns (gmb) wrote :

Trying to run this through EC2 I got a mass of conflicts:

Warning: criss-cross merge encountered. See bzr help criss-cross.
[...]
Text conflict in lib/lp/archivepublisher/tests/test_dominator.py
Text conflict in lib/lp/archiveuploader/tests/nascentupload-ddebs.txt
Text conflict in lib/lp/soyuz/doc/build-files.txt
Text conflict in lib/lp/soyuz/doc/publishing.txt
Text conflict in lib/lp/soyuz/doc/sourcepackagerelease.txt
Text conflict in lib/lp/soyuz/scripts/tests/test_changeoverride.py
Text conflict in lib/lp/soyuz/scripts/tests/test_copypackage.py
Text conflict in lib/lp/soyuz/tests/test_publish_archive_indexes.py
Text conflict in lib/lp/soyuz/tests/test_publishing.py
Text conflict in lib/lp/testing/factory.py
Text conflict in lib/lp/testing/matchers.py
Text conflict in lib/lp/testing/tests/test_factory.py
Text conflict in lib/lp/testing/tests/test_matchers.py

Please resolve these and then ping me and I'll be happy to re-try the landing.

Revision history for this message
Robert Collins (lifeless) wrote :

This clearly needs more work to be usable :(.

Revision history for this message
Brad Crittenden (bac) wrote :

This branch depends on two pre-requisite branches that have been marked as 'Work In Progress', so this one cannot progress until they do. I am therefore marking this branch WIP too.

Unmerged revisions

11337. By James Westby

Allow publishing records in the superseded check.

11336. By James Westby

Fix matcher import.

11335. By James Westby

Use a normal function, not an inline one for title_of.

11334. By James Westby

Rename PublishedStateIsNot to PublishedStateIsWrong as the first sounds like a matcher.

11333. By James Westby

Fix the docstrings given that it's not publications that superseded publications.

11332. By James Westby

Dummy revision to force diff regeneration.

11331. By James Westby

Clean up some lint.

11330. By James Westby

Replace checkSuperseded with the new matcher.

11329. By James Westby

Add an IsSupersededBy matcher.

11328. By James Westby

Have test_publishing use the new matcher.

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.