~launchpad-pqm/launchpad/devel

10466.2.1 by Curtis Hovey
Exported IBugTrackerSet and ensureBugTracker().
1
Bug tracker
2
===========
3
4
The bug tracker set is exported as a collection at /bugs/bugtrackers that
5
any user can access.
6
7
    >>> from lazr.restful.testing.webservice import (
8
    ...     pprint_collection, pprint_entry)
9
10
    >>> bug_tracker_collection = anon_webservice.get(
11
    ...     '/bugs/bugtrackers').jsonBody()
12
    >>> pprint_collection(bug_tracker_collection)
13404.1.1 by William Grant
Revert r13392. It breaks when there are multiple batchnavs on a single page.
13
    next_collection_link: u'http://.../bugs/bugtrackers?ws.start=5&ws.size=5'
10466.2.3 by Curtis Hovey
Made the test robust. Exported two other methods to get a bug tracker.
14
    resource_type_link: u'http://.../#bug_trackers'
10466.2.1 by Curtis Hovey
Exported IBugTrackerSet and ensureBugTracker().
15
    start: 0
16
    total_size: 8
17
    ---
18
    active: True
19
    base_url: u'https://bugzilla.mozilla.org/'
20
    base_url_aliases: []
21
    bug_tracker_type: u'Bugzilla'
22
    contact_details: u'Carrier pigeon only'
23
    has_lp_plugin: None
24
    name: u'mozilla.org'
10466.2.3 by Curtis Hovey
Made the test robust. Exported two other methods to get a bug tracker.
25
    registrant_link: u'http://.../~name12'
26
    resource_type_link: u'http://.../#bug_tracker'
27
    self_link: u'http://.../bugs/bugtrackers/mozilla.org'
10466.2.1 by Curtis Hovey
Exported IBugTrackerSet and ensureBugTracker().
28
    summary: u'The Mozilla.org bug tracker is the grand-daddy of ...'
29
    title: u'The Mozilla.org Bug Tracker'
10466.2.3 by Curtis Hovey
Made the test robust. Exported two other methods to get a bug tracker.
30
    watches_collection_link: u'http:.../bugs/bugtrackers/mozilla.org/watches'
12243.5.5 by Leonard Richardson
Fixed a few tests.
31
    web_link: u'http://bugs.launchpad.dev/bugs/bugtrackers/mozilla.org'
10466.2.1 by Curtis Hovey
Exported IBugTrackerSet and ensureBugTracker().
32
    --- ...
33
10466.2.3 by Curtis Hovey
Made the test robust. Exported two other methods to get a bug tracker.
34
A bug tracker can be retrieved using the the bug tracker collection's
35
getByName named operation.
36
37
    >>> bug_tracker = anon_webservice.named_get(
38
    ...     '/bugs/bugtrackers', 'getByName',
39
    ...     name='gnome-bugzilla').jsonBody()
40
    >>> print bug_tracker['name']
41
    gnome-bugzilla
42
43
A bug tracker can be retrieved using the the bug tracker collection's
44
queryByBaseURL named operation.
45
46
    >>> bug_tracker = anon_webservice.named_get(
47
    ...     '/bugs/bugtrackers', 'queryByBaseURL',
48
    ...     base_url='https://bugzilla.mozilla.org/').jsonBody()
49
    >>> print bug_tracker['name']
50
    mozilla.org
51
10466.2.2 by Curtis Hovey
Fixed spelling.
52
The bug tracker set provides the ensureBugTracker named operation that a
10466.2.1 by Curtis Hovey
Exported IBugTrackerSet and ensureBugTracker().
53
logged in user can call to create a bug tracker.
54
55
    >>> params = dict(
56
    ...     base_url='http://wombat.zz/', bug_tracker_type='Bugzilla',
57
    ...     name='wombat', title='Wombat title', summary='Wombat summary',
58
    ...     contact_details='big-nose@wombat.zz')
59
    >>> print webservice.named_post(
60
    ...     '/bugs/bugtrackers', 'ensureBugTracker', **params)
61
    HTTP/1.1 201 Created ...
10466.2.3 by Curtis Hovey
Made the test robust. Exported two other methods to get a bug tracker.
62
    Location: http://.../bugs/bugtrackers/wombat ...
10466.2.1 by Curtis Hovey
Exported IBugTrackerSet and ensureBugTracker().
63
64
    >>> bug_tracker = webservice.get('/bugs/bugtrackers/wombat').jsonBody()
65
    >>> pprint_entry(bug_tracker)
66
    active: True
67
    base_url: u'http://wombat.zz/'
68
    base_url_aliases: []
69
    bug_tracker_type: u'Bugzilla'
10701.2.1 by Gavin Panella
Correct the spelling of contat_details.
70
    contact_details: u'big-nose@wombat.zz'
10466.2.1 by Curtis Hovey
Exported IBugTrackerSet and ensureBugTracker().
71
    has_lp_plugin: False
72
    name: u'wombat'
10466.2.3 by Curtis Hovey
Made the test robust. Exported two other methods to get a bug tracker.
73
    registrant_link: u'http://.../~salgado'
74
    resource_type_link: u'http://.../#bug_tracker'
75
    self_link: u'http://.../bugs/bugtrackers/wombat'
10466.2.1 by Curtis Hovey
Exported IBugTrackerSet and ensureBugTracker().
76
    summary: u'Wombat summary'
77
    title: u'Wombat title'
10466.2.3 by Curtis Hovey
Made the test robust. Exported two other methods to get a bug tracker.
78
    watches_collection_link: u'http://.../bugs/bugtrackers/wombat/watches'
12243.5.5 by Leonard Richardson
Fixed a few tests.
79
    web_link: u'http://bugs.launchpad.dev/bugs/bugtrackers/wombat'