Merge lp:~stevenk/launchpad/db-fix-disabled-dases-test into lp:launchpad/db-devel

Proposed by Steve Kowalik on 2010-10-07
Status: Merged
Approved by: Robert Collins on 2010-10-07
Approved revision: no longer in the source branch.
Merged at revision: 9872
Proposed branch: lp:~stevenk/launchpad/db-fix-disabled-dases-test
Merge into: lp:launchpad/db-devel
Diff against target: 32 lines (+4/-13)
1 file modified
lib/lp/soyuz/scripts/tests/test_initialise_distroseries.py (+4/-13)
To merge this branch: bzr merge lp:~stevenk/launchpad/db-fix-disabled-dases-test
Reviewer Review Type Date Requested Status
Robert Collins (community) 2010-10-07 Approve on 2010-10-07
Review via email: mp+37819@code.launchpad.net

Description of the Change

This branch fixes the test_do_not_copy_disabled_dases test to no longer rely on helper functions that got ripped out when the sampledata was removed, as well as cleaning it up to use things that were added.

To post a comment you must log in.
Robert Collins (lifeless) wrote :

Stylistically i dislike self.parent etc, but if this works, its fine to land it.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/soyuz/scripts/tests/test_initialise_distroseries.py'
2--- lib/lp/soyuz/scripts/tests/test_initialise_distroseries.py 2010-10-06 20:34:27 +0000
3+++ lib/lp/soyuz/scripts/tests/test_initialise_distroseries.py 2010-10-07 05:38:42 +0000
4@@ -244,24 +244,15 @@
5
6 def test_do_not_copy_disabled_dases(self):
7 # DASes that are disabled in the parent will not be copied
8- i386 = self.factory.makeProcessorFamily()
9- ppc = self.factory.makeProcessorFamily()
10- parent = self.factory.makeDistroSeries()
11- i386_das = self.factory.makeDistroArchSeries(
12- distroseries=parent, processorfamily=i386)
13 ppc_das = self.factory.makeDistroArchSeries(
14- distroseries=parent, processorfamily=ppc)
15+ distroseries=self.parent)
16 ppc_das.enabled = False
17- parent.nominatedarchindep = i386_das
18- foobuntu = self._create_distroseries(parent)
19- ids = InitialiseDistroSeries(foobuntu)
20- ids.check()
21- ids.initialise()
22+ child = self._full_initialise()
23 das = list(IStore(DistroArchSeries).find(
24- DistroArchSeries, distroseries = foobuntu))
25+ DistroArchSeries, distroseries = child))
26 self.assertEqual(len(das), 1)
27 self.assertEqual(
28- das[0].architecturetag, i386_das.architecturetag)
29+ das[0].architecturetag, self.parent_das.architecturetag)
30
31 def test_script(self):
32 # Do an end-to-end test using the command-line tool

Subscribers

People subscribed via source and target branches

to status/vote changes: