Merge lp:~cjwatson/launchpad/queue-copy-archive-links-testfix into lp:launchpad

Proposed by Colin Watson
Status: Merged
Approved by: Steve Kowalik
Approved revision: no longer in the source branch.
Merged at revision: 16571
Proposed branch: lp:~cjwatson/launchpad/queue-copy-archive-links-testfix
Merge into: lp:launchpad
Diff against target: 78 lines (+10/-17)
3 files modified
lib/lp/app/browser/tales.py (+6/-14)
lib/lp/soyuz/stories/soyuz/xx-build-record.txt (+3/-3)
lib/lp/soyuz/stories/webservice/xx-packageupload.txt (+1/-0)
To merge this branch: bzr merge lp:~cjwatson/launchpad/queue-copy-archive-links-testfix
Reviewer Review Type Date Requested Status
Steve Kowalik (community) code Approve
Review via email: mp+159442@code.launchpad.net

Commit message

Fix queue-copy-archive-links test failures.

Description of the change

Fixes for buildbot failures caused by https://code.launchpad.net/~cjwatson/launchpad/queue-copy-archive-links/+merge/159250, missed in EC2 test attempt.

bin/test -vvct lib/lp/app/doc/tales.txt -t lp.soyuz.browser.tests.test_queue -t lp.soyuz.tests.test_packageupload -t lp.testing.tests.test_factory -t lib/lp/soyuz/stories/soyuz/xx-build-record.txt -t lib/lp/soyuz/stories/distribution/xx-distribution-packages.txt -t lib/lp/soyuz/stories/webservice/xx-packageupload.txt

To post a comment you must log in.
Revision history for this message
Steve Kowalik (stevenk) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/app/browser/tales.py'
2--- lib/lp/app/browser/tales.py 2013-04-17 10:51:39 +0000
3+++ lib/lp/app/browser/tales.py 2013-04-17 16:49:29 +0000
4@@ -1864,19 +1864,6 @@
5 final_traversable_names.update(
6 CustomizableFormatter.final_traversable_names)
7
8- def url(self, view_name=None, rootsite='mainsite'):
9- """See `ObjectFormatterAPI`.
10-
11- The default URL for a distribution main archive is the URL of the
12- distribution. Other archive URLs are constructed as normal.
13- """
14- if self._context.is_main:
15- return queryAdapter(
16- self._context.distribution, IPathAdapter, 'fmt').url(
17- view_name, rootsite)
18- else:
19- return super(ArchiveFormatterAPI, self).url(view_name, rootsite)
20-
21 def _link_summary_values(self):
22 """See CustomizableFormatter._link_summary_values."""
23 return {'display_name': self._context.displayname}
24@@ -1895,7 +1882,12 @@
25 summary = self._make_link_summary()
26 css = self.sprite_css()
27 if check_permission(self._link_permission, self._context):
28- url = self.url(view_name)
29+ if self._context.is_main:
30+ url = queryAdapter(
31+ self._context.distribution, IPathAdapter, 'fmt').url(
32+ view_name)
33+ else:
34+ url = self.url(view_name)
35 return '<a href="%s" class="%s">%s</a>' % (url, css, summary)
36 else:
37 if not self._context.private:
38
39=== modified file 'lib/lp/soyuz/stories/soyuz/xx-build-record.txt'
40--- lib/lp/soyuz/stories/soyuz/xx-build-record.txt 2013-01-22 02:06:59 +0000
41+++ lib/lp/soyuz/stories/soyuz/xx-build-record.txt 2013-04-17 16:49:29 +0000
42@@ -98,7 +98,7 @@
43 Pocket: Release
44 Component: main
45
46-Re-enable the build in order to avioid subsequent test breakage.
47+Re-enable the build in order to avoid subsequent test breakage.
48
49 >>> login('foo.bar@canonical.com')
50 >>> build.buildqueue_record.job.resume()
51@@ -106,13 +106,13 @@
52 >>> anon_browser.open(build_url)
53
54 The 'Build details' section exists for all status and contains links
55-to all the relevant entities involed in this build.
56+to all the relevant entities involved in this build.
57
58 >>> print anon_browser.getLink('testing - 1.0').url
59 http://launchpad.dev/ubuntutest/+source/testing/1.0
60
61 >>> print anon_browser.getLink('Primary Archive for Ubuntu Test').url
62- http://launchpad.dev/ubuntutest/+archive/primary
63+ http://launchpad.dev/ubuntutest
64
65 >>> print anon_browser.getLink('Breezy Badger Autotest').url
66 http://launchpad.dev/ubuntutest/breezy-autotest
67
68=== modified file 'lib/lp/soyuz/stories/webservice/xx-packageupload.txt'
69--- lib/lp/soyuz/stories/webservice/xx-packageupload.txt 2012-07-02 16:04:09 +0000
70+++ lib/lp/soyuz/stories/webservice/xx-packageupload.txt 2013-04-17 16:49:29 +0000
71@@ -19,6 +19,7 @@
72 >>> from lazr.restful.testing.webservice import pprint_entry
73 >>> pprint_entry(uploads['entries'][0])
74 archive_link: u'http://.../ubuntu/+archive/primary'
75+ copy_source_archive_link: None
76 custom_file_urls: []
77 date_created: ...
78 display_arches: u'source'