launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #01707
[Merge] lp:~stevenk/launchpad/derivedistroseries-api-qafail into lp:launchpad/devel
Steve Kowalik has proposed merging lp:~stevenk/launchpad/derivedistroseries-api-qafail into lp:launchpad/devel.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
This branch fixes the issues discovered while attempting to QA the branch that adds support for the deriveDistroSeries() API call. It adds tests for this case, as well as making use of lp.testing.sampledata.
--
https://code.launchpad.net/~stevenk/launchpad/derivedistroseries-api-qafail/+merge/39468
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/derivedistroseries-api-qafail into lp:launchpad/devel.
=== modified file 'lib/lp/registry/interfaces/distroseries.py'
--- lib/lp/registry/interfaces/distroseries.py 2010-10-18 04:19:10 +0000
+++ lib/lp/registry/interfaces/distroseries.py 2010-10-27 19:09:48 +0000
@@ -809,11 +809,11 @@
status=copy_field(status, required=False),
architectures=List(
title=_("The list of architectures to copy to the derived "
- "distroseries."),
+ "distroseries."), value_type=TextLine(),
required=False),
packagesets=List(
title=_("The list of packagesets to copy to the derived "
- "distroseries"),
+ "distroseries"), value_type=TextLine(),
required=False),
rebuild=Bool(
title=_("If binaries will be copied to the derived "
=== modified file 'lib/lp/registry/stories/webservice/xx-derivedistroseries.txt'
--- lib/lp/registry/stories/webservice/xx-derivedistroseries.txt 2010-09-21 04:11:08 +0000
+++ lib/lp/registry/stories/webservice/xx-derivedistroseries.txt 2010-10-27 19:09:48 +0000
@@ -8,10 +8,12 @@
Set Up
------
- >>> login('admin@xxxxxxxxxxxxx')
+ >>> from lp.testing.sampledata import ADMIN_EMAIL
+ >>> login(ADMIN_EMAIL)
>>> soyuz = factory.makeTeam(name='soyuz-team')
>>> parent = factory.makeDistroSeries()
>>> child = factory.makeDistroSeries(parent_series=parent)
+ >>> second_child = factory.makeDistroSeries(parent_series=parent)
>>> other = factory.makeDistroSeries()
>>> logout()
>>> from canonical.launchpad.testing.pages import webservice_for_person
@@ -55,14 +57,27 @@
<BLANKLINE>
...
-And we can verify the job exists.
+If we call it with all of the arguments, it also works.
+
+ >>> child_name = second_child.name
+ >>> derived = soyuz_webservice.named_post(
+ ... series['self_link'], 'deriveDistroSeries', {},
+ ... name=child_name, architectures=('i386',),
+ ... packagesets=('test1',), rebuild=False)
+ >>> print derived
+ HTTP/1.1 200 Ok
+ Status: 200 Ok
+ ...
+ <BLANKLINE>
+ ...
+
+And we can verify both jobs exists.
>>> from zope.component import getUtility
>>> from lp.soyuz.interfaces.distributionjob import (
... IInitialiseDistroSeriesJobSource)
- >>> login('admin@xxxxxxxxxxxxx')
- >>> [job] = list(
+ >>> login(ADMIN_EMAIL)
+ >>> job = list(
... getUtility(IInitialiseDistroSeriesJobSource).iterReady())
- >>> job.distroseries == child
+ >>> [job[0].distroseries, job[1].distroseries] == [child, second_child]
True
-