~launchpad-pqm/launchpad/devel

10355.4.6 by Adi Roiban
Update potemplate api implementation.
1
Distribution Series
2
===================
7310.3.3 by Julian Edwards
Add tests for distroseries webservice
3
4
We can get a distroseries object via a distribution object in several ways:
5
6
    >>> distros = webservice.get("/distros").jsonBody()
7
    >>> ubuntu = distros['entries'][0]
7310.3.7 by Julian Edwards
Cprov's review comments
8
    >>> print ubuntu['self_link']
9
    http://.../ubuntu
7310.3.3 by Julian Edwards
Add tests for distroseries webservice
10
11
Via all the available series:
12
13
    >>> all_series = webservice.get(
14
    ...     ubuntu['series_collection_link']).jsonBody()
15
    >>> for entry in all_series['entries']:
16
    ...     print entry['self_link']
17
    http://.../ubuntu/breezy-autotest
18
    http://.../ubuntu/grumpy
19
    http://.../ubuntu/hoary
20
    http://.../ubuntu/warty
21
10259.1.1 by Brad Crittenden
Create launchpad.View for IDistroSeries so collections with work with anonymous API access.
22
The series are available to the anonymous API user too:
23
24
    >>> all_series = anon_webservice.get(
25
    ...     ubuntu['series_collection_link']).jsonBody()
26
    >>> for entry in all_series['entries']:
27
    ...     print entry['self_link']
28
    http://.../ubuntu/breezy-autotest
29
    http://.../ubuntu/grumpy
30
    http://.../ubuntu/hoary
31
    http://.../ubuntu/warty
32
7310.3.3 by Julian Edwards
Add tests for distroseries webservice
33
Via the current series:
34
35
    >>> current_series = webservice.get(
36
    ...     ubuntu['current_series_link']).jsonBody()
37
    >>> print current_series['self_link']
38
    http://.../ubuntu/hoary
39
40
Via the collection of development series:
41
42
    >>> dev_series = webservice.named_get(
43
    ...     ubuntu['self_link'], 'getDevelopmentSeries').jsonBody()
44
    >>> for entry in sorted(dev_series['entries']):
45
    ...     print entry['self_link']
46
    http://.../ubuntu/hoary
47
48
And via a direct query of a named series:
49
7310.3.6 by Julian Edwards
re-enable some tests
50
    >>> series = webservice.named_get(
51
    ...     ubuntu['self_link'], 'getSeries',
52
    ...     name_or_version='hoary').jsonBody()
53
    >>> print series['self_link']
54
    http://.../ubuntu/hoary
7310.3.3 by Julian Edwards
Add tests for distroseries webservice
55
56
For distroseries we publish a subset of its attributes.
57
8122.4.5 by Leonard Richardson
Switched over to the new testing.webservice file.
58
    >>> from lazr.restful.testing.webservice import pprint_entry
7310.3.3 by Julian Edwards
Add tests for distroseries webservice
59
    >>> pprint_entry(current_series)
7368.5.7 by Gavin Panella
Fix some encoding/decoding inconsistencies, and update the tests for bug_reporting_guidelines.
60
    active: True
7310.3.3 by Julian Edwards
Add tests for distroseries webservice
61
    active_milestones_collection_link:
62
        u'http://.../ubuntu/hoary/active_milestones'
63
    all_milestones_collection_link: u'http://.../ubuntu/hoary/all_milestones'
12494.1.29 by Gavin Panella
Export architectures for IDistroSeries via the web API.
64
    architectures_collection_link: u'http://.../ubuntu/hoary/architectures'
7675.712.2 by Abel Deuring
add the property bug_reported_acknowledgement to class DistributionSourcePackageInDatabase; fix a number of failing tests
65
    bug_reported_acknowledgement: None
7368.5.7 by Gavin Panella
Fix some encoding/decoding inconsistencies, and update the tests for bug_reporting_guidelines.
66
    bug_reporting_guidelines: None
7310.3.3 by Julian Edwards
Add tests for distroseries webservice
67
    changeslist: u'hoary-changes@ubuntu.com'
7675.1179.41 by Raphael Badin
Testfix.
68
    component_names: [u'main', u'restricted']
7310.3.3 by Julian Edwards
Add tests for distroseries webservice
69
    date_created: u'2006-10-16T18:31:43.483559+00:00'
70
    datereleased: None
71
    description: u'Hoary is the ...
72
    displayname: u'Hoary'
73
    distribution_link: u'http://.../ubuntu'
74
    driver_link: None
10427.21.6 by Adi Roiban
Fix failing tests.
75
    drivers_collection_link: u'http://.../ubuntu/hoary/drivers'
7310.3.3 by Julian Edwards
Add tests for distroseries webservice
76
    fullseriesname: u'Ubuntu Hoary'
13404.4.12 by Colin Watson
Fix doctest.
77
    include_long_descriptions: True
7310.3.3 by Julian Edwards
Add tests for distroseries webservice
78
    main_archive_link: u'http://.../ubuntu/+archive/primary'
79
    name: u'hoary'
14108.3.2 by Raphael Badin
Add nominatedarchindep_link.
80
    nominatedarchindep_link: u'http://.../ubuntu/hoary/i386'
7949.2.8 by Tom Berger
make sure official_bug_tags is writable from the API for IProduct and IDistribution
81
    official_bug_tags: []
7675.1070.6 by Raphael Badin
Fixed tests.
82
    owner_link: u'http://.../~ubuntu-team'
13045.14.7 by Gavin Panella
Test (and fix) the exported versions for DistroSeries.previous_series.
83
    parent_series_link: u'http://.../ubuntu/warty'
7675.1070.6 by Raphael Badin
Fixed tests.
84
    registrant_link: u'http://.../~mark'
7310.3.3 by Julian Edwards
Add tests for distroseries webservice
85
    resource_type_link: ...
86
    self_link: u'http://.../ubuntu/hoary'
87
    status: u'Active Development'
7675.1179.41 by Raphael Badin
Testfix.
88
    suite_names:
89
        [u'Release', u'Security', u'Updates', u'Proposed', u'Backports']
7310.3.3 by Julian Edwards
Add tests for distroseries webservice
90
    summary: u'Hoary is the ...
91
    supported: False
92
    title: u'The Hoary Hedgehog Release'
93
    version: u'5.04'
12243.5.6 by Leonard Richardson
Got another batch of tests to pass.
94
    web_link: u'http://launchpad.../ubuntu/hoary'
9341.1.5 by Curtis Hovey
Added test to verify that distroseries support newMilestone over the api. Updated
95
12494.1.29 by Gavin Panella
Export architectures for IDistroSeries via the web API.
96
13045.14.7 by Gavin Panella
Test (and fix) the exported versions for DistroSeries.previous_series.
97
Getting the previous series
98
---------------------------
99
100
In the beta version of the API the previous series is obtained via
101
parent_series_link:
102
103
    >>> current_series_beta = webservice.get(
104
    ...     "/ubuntu/hoary", api_version="beta").jsonBody()
105
    >>> current_series_beta["parent_series_link"]
106
    u'http://.../ubuntu/warty'
107
108
In the 1.0 version of the API the previous series is obtained via
109
parent_series_link:
110
111
    >>> current_series_1_0 = webservice.get(
112
    ...     "/ubuntu/hoary", api_version="1.0").jsonBody()
113
    >>> current_series_1_0["parent_series_link"]
114
    u'http://.../ubuntu/warty'
115
116
In the devel version of the API the previous series is obtained via
117
parent_series_link:
118
119
    >>> current_series_devel = webservice.get(
120
    ...     "/ubuntu/hoary", api_version="devel").jsonBody()
121
    >>> current_series_devel["previous_series_link"]
122
    u'http://.../ubuntu/warty'
123
124
9341.1.5 by Curtis Hovey
Added test to verify that distroseries support newMilestone over the api. Updated
125
Creating a milestone on the distroseries
126
----------------------------------------
127
128
    >>> response = webservice.named_post(
129
    ...     current_series['self_link'], 'newMilestone', {},
130
    ...     name='alpha1', code_name='wombat', date_targeted=u'2009-09-06',
131
    ...     summary='summary.')
132
    >>> print response
133
    HTTP/1.1 201 Created
134
    ...
135
    Location: http://.../ubuntu/+milestone/alpha1
136
    ...