Merge lp:~stub/launchpad/librarian-layer into lp:launchpad

Proposed by Stuart Bishop
Status: Merged
Approved by: Stuart Bishop
Approved revision: no longer in the source branch.
Merged at revision: 12232
Proposed branch: lp:~stub/launchpad/librarian-layer
Merge into: lp:launchpad
Prerequisite: lp:~lifeless/launchpad/librarian
Diff against target: 1015 lines (+139/-136)
40 files modified
lib/canonical/config/fixture.py (+0/-1)
lib/canonical/config/tests/test_fixture.py (+3/-6)
lib/canonical/launchpad/doc/canonical-config.txt (+0/-8)
lib/canonical/launchpad/doc/librarian.txt (+25/-18)
lib/canonical/launchpad/doc/message.txt (+0/-2)
lib/canonical/launchpad/doc/old-testing.txt (+2/-1)
lib/canonical/launchpad/pagetests/webservice/xx-hostedfile.txt (+3/-3)
lib/canonical/launchpad/scripts/ftests/librarianformatter.txt (+6/-6)
lib/canonical/librarian/ftests/test_web.py (+9/-20)
lib/canonical/librarian/testing/server.py (+17/-3)
lib/canonical/librarian/testing/tests/test_server_fixture.py (+17/-6)
lib/canonical/testing/ftests/test_layers.py (+2/-2)
lib/canonical/testing/layers.py (+10/-7)
lib/lp/bugs/browser/tests/test_bugattachment_file_access.py (+5/-5)
lib/lp/bugs/stories/webservice/xx-bug.txt (+1/-1)
lib/lp/code/stories/branches/xx-person-portlet-teambranches.txt (+1/-1)
lib/lp/hardwaredb/stories/hwdb/02-view-submissions.txt (+3/-3)
lib/lp/hardwaredb/stories/webservice/xx-hwdb.txt (+1/-1)
lib/lp/registry/stories/product/xx-product-files.txt (+4/-4)
lib/lp/registry/stories/webservice/xx-project-registry.txt (+2/-2)
lib/lp/registry/tests/test_distroseriesdifference.py (+1/-2)
lib/lp/soyuz/doc/distroarchseries.txt (+1/-1)
lib/lp/soyuz/doc/soyuz-files.txt (+2/-2)
lib/lp/soyuz/stories/ppa/xx-ppa-files.txt (+2/-2)
lib/lp/soyuz/stories/soyuz/xx-distro-package-pages.txt (+1/-1)
lib/lp/soyuz/stories/soyuz/xx-distroarchseries-binpackages.txt (+1/-1)
lib/lp/soyuz/stories/soyuz/xx-distroseries-sources.txt (+1/-1)
lib/lp/soyuz/stories/soyuz/xx-queue-pages-delayed-copies.txt (+1/-1)
lib/lp/soyuz/stories/soyuz/xx-queue-pages.txt (+2/-2)
lib/lp/soyuz/stories/webservice/xx-distroarchseries.txt (+1/-1)
lib/lp/soyuz/tests/test_publishing_models.py (+4/-6)
lib/lp/testing/__init__.py (+1/-6)
lib/lp/translations/doc/poexport-queue.txt (+1/-1)
lib/lp/translations/doc/poexport-request-productseries.txt (+1/-1)
lib/lp/translations/doc/poexport-request.txt (+2/-2)
lib/lp/translations/doc/poimport-pofile-not-exported-from-rosetta.txt (+1/-1)
lib/lp/translations/doc/poimport-pofile-old-po-imported.txt (+1/-1)
lib/lp/translations/doc/poimport-pofile-syntax-error.txt (+1/-1)
lib/lp/translations/doc/poimport-potemplate-syntax-error.txt (+2/-2)
lib/lp/translations/stories/standalone/xx-translations-xpi-import.txt (+1/-1)
To merge this branch: bzr merge lp:~stub/launchpad/librarian-layer
Reviewer Review Type Date Requested Status
Stuart Bishop (community) Approve
Review via email: mp+44466@code.launchpad.net

Commit message

[r=stub][ui=none][bug=661009,692872] Numerous Librarian test infrastructure improvements.

Description of the change

Fixes required to get lp:~lifeless/launchpad/librarian landed

To post a comment you must log in.
Revision history for this message
Stuart Bishop (stub) wrote :

Subunit stream of remaining failures (4) at http://paste.ubuntu.com/546626/

Includes some launchpadlib failures that need to be fixed in that tree.

Revision history for this message
Stuart Bishop (stub) wrote :

lp:~stub/launchpadlib/dynamiclibrarian needs to land and new egg prepared to fix a launchpadlib test that relies on the Librarian running on port 58000.

Revision history for this message
Stuart Bishop (stub) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/canonical/config/fixture.py'
--- lib/canonical/config/fixture.py 2010-10-30 19:22:58 +0000
+++ lib/canonical/config/fixture.py 2011-01-19 13:41:53 +0000
@@ -28,7 +28,6 @@
28 _extend_str = dedent("""\28 _extend_str = dedent("""\
29 [meta]29 [meta]
30 extends: ../%s/launchpad-lazr.conf30 extends: ../%s/launchpad-lazr.conf
31
32 """)31 """)
3332
34 def __init__(self, instance_name, copy_from_instance):33 def __init__(self, instance_name, copy_from_instance):
3534
=== modified file 'lib/canonical/config/tests/test_fixture.py'
--- lib/canonical/config/tests/test_fixture.py 2010-10-19 19:23:19 +0000
+++ lib/canonical/config/tests/test_fixture.py 2011-01-19 13:41:53 +0000
@@ -50,11 +50,8 @@
50 confpath = 'configs/testtestconfig/launchpad-lazr.conf'50 confpath = 'configs/testtestconfig/launchpad-lazr.conf'
51 lazr_config = open(confpath, 'rb').read()51 lazr_config = open(confpath, 'rb').read()
52 self.assertEqual(52 self.assertEqual(
53 dedent("""\53 "[meta]\n"
54 [meta]54 "extends: ../testrunner/launchpad-lazr.conf",
55 extends: ../testrunner/launchpad-lazr.conf55 lazr_config.strip())
56
57 """),
58 lazr_config)
59 finally:56 finally:
60 fixture.cleanUp()57 fixture.cleanUp()
6158
=== modified file 'lib/canonical/launchpad/doc/canonical-config.txt'
--- lib/canonical/launchpad/doc/canonical-config.txt 2010-11-27 21:42:32 +0000
+++ lib/canonical/launchpad/doc/canonical-config.txt 2011-01-19 13:41:53 +0000
@@ -24,14 +24,6 @@
24 'launchpad_main'24 'launchpad_main'
25 >>> config.librarian.dbuser25 >>> config.librarian.dbuser
26 'librarian'26 'librarian'
27 >>> config.librarian.upload_host
28 'localhost'
29 >>> config.librarian.upload_port
30 59090
31 >>> config.librarian.download_host
32 'localhost'
33 >>> config.librarian.download_port
34 58000
3527
36Configs are kept from the 'configs' directory.28Configs are kept from the 'configs' directory.
3729
3830
=== modified file 'lib/canonical/launchpad/doc/librarian.txt'
--- lib/canonical/launchpad/doc/librarian.txt 2011-01-19 02:05:39 +0000
+++ lib/canonical/launchpad/doc/librarian.txt 2011-01-19 13:41:53 +0000
@@ -78,9 +78,11 @@
7878
79We can get its URL too79We can get its URL too
8080
81 >>> from canonical.config import config
81 >>> import re82 >>> import re
82 >>> re.search(83 >>> re.search(
83 ... r'^http://localhost:58000/\d+/text.txt$', alias.http_url84 ... r'^%s\d+/text.txt$' % config.librarian.download_url,
85 ... alias.http_url
84 ... ) is not None86 ... ) is not None
85 True87 True
8688
@@ -88,19 +90,17 @@
88and similar inline-presented objects which would trigger security warnings on90and similar inline-presented objects which would trigger security warnings on
89https pages otherwise.91https pages otherwise.
9092
91 >>> re.search(93 >>> re.search(r'^https://.+/\d+/text.txt$', alias.https_url) is not None
92 ... r'^https://localhost:58000/\d+/text.txt$', alias.https_url
93 ... ) is not None
94 True94 True
9595
96And we even have a convenient method which returns either the http URL or the96And we even have a convenient method which returns either the http URL or the
97https one, depending on a config value.97https one, depending on a config value.
9898
99 >>> from canonical.config import config
100 >>> config.vhosts.use_https99 >>> config.vhosts.use_https
101 False100 False
102 >>> re.search(101 >>> re.search(
103 ... r'^http://localhost:58000/\d+/text.txt$', alias.getURL()102 ... r'^%s\d+/text.txt$' % config.librarian.download_url,
103 ... alias.getURL()
104 ... ) is not None104 ... ) is not None
105 True105 True
106106
@@ -111,7 +111,7 @@
111 ... """)111 ... """)
112 >>> config.push('test', test_data)112 >>> config.push('test', test_data)
113 >>> re.search(113 >>> re.search(
114 ... r'^https://localhost:58000/\d+/text.txt$', alias.https_url114 ... r'^https://.+/\d+/text.txt$', alias.https_url
115 ... ) is not None115 ... ) is not None
116 True116 True
117117
@@ -208,15 +208,17 @@
208 >>> f.read()208 >>> f.read()
209 'This is some data'209 'This is some data'
210 >>> url = client.getURLForAlias(aid)210 >>> url = client.getURLForAlias(aid)
211 >>> re.search(r'^http://localhost:58000/\d+/text.txt$', url) is not None211 >>> re.search(
212 ... r'^%s\d+/text.txt$' % config.librarian.download_url, url
213 ... ) is not None
212 True214 True
213215
214When secure=True, the returned url has the id as part of the domain name and216When secure=True, the returned url has the id as part of the domain name and
215the protocol is https:217the protocol is https:
216218
217 >>> expected = 'https://i%d.restricted.localhost:58000/%d/text.txt' % (219 >>> expected = r'^https://i%d\..+:\d+/%d/text.txt$' % (aid, aid)
218 ... aid, aid)220 >>> found = client.getURLForAlias(aid, secure=True)
219 >>> expected == client.getURLForAlias(aid, secure=True)221 >>> re.search(expected, found) is not None
220 True222 True
221223
222224
@@ -250,7 +252,7 @@
250 ... 'text.txt', len(data), StringIO(data), 'text/plain'252 ... 'text.txt', len(data), StringIO(data), 'text/plain'
251 ... )253 ... )
252 >>> print url254 >>> print url
253 http://localhost:58000/.../text.txt255 http://.../text.txt
254 >>> from urllib2 import urlopen256 >>> from urllib2 import urlopen
255 >>> urlopen(url).read()257 >>> urlopen(url).read()
256 'This is some data'258 'This is some data'
@@ -277,7 +279,7 @@
277client can't see the database records yet).279client can't see the database records yet).
278280
279 >>> import re281 >>> import re
280 >>> match = re.search('^http://localhost:\d+/(\d+)/', url)282 >>> match = re.search('/(\d+)/', url)
281 >>> alias_id = int(match.group(1))283 >>> alias_id = int(match.group(1))
282 >>> alias = lfas[alias_id]284 >>> alias = lfas[alias_id]
283 >>> print alias.expires.isoformat()285 >>> print alias.expires.isoformat()
@@ -311,7 +313,10 @@
311 True313 True
312314
313 >>> print file_alias.http_url315 >>> print file_alias.http_url
314 http://localhost:58005/.../private.txt316 http://.../private.txt
317 >>> file_alias.http_url.startswith(
318 ... config.librarian.restricted_download_url)
319 True
315320
316 >>> transaction.commit()321 >>> transaction.commit()
317 >>> file_alias.open()322 >>> file_alias.open()
@@ -339,7 +344,7 @@
339344
340 >>> file_url = restricted_client.getURLForAlias(private_file_id)345 >>> file_url = restricted_client.getURLForAlias(private_file_id)
341 >>> print file_url346 >>> print file_url
342 http://localhost:58005/.../private.txt347 http://.../private.txt
343348
344Trying to access that file directly on the normal librarian will fail349Trying to access that file directly on the normal librarian will fail
345(by switching the port)350(by switching the port)
@@ -386,7 +391,9 @@
386 ... 'another-private.txt', len(private_content),391 ... 'another-private.txt', len(private_content),
387 ... StringIO(private_content), 'text/plain')392 ... StringIO(private_content), 'text/plain')
388 >>> print url393 >>> print url
389 http://localhost:58005/.../another-private.txt394 http://.../another-private.txt
395 >>> url.startswith(config.librarian.restricted_download_url)
396 True
390397
391The file can then immediately be retrieved:398The file can then immediately be retrieved:
392399
@@ -459,7 +466,7 @@
459 >>> f.read()466 >>> f.read()
460 'This is some data'467 'This is some data'
461 >>> url = client.getURLForAlias(aid)468 >>> url = client.getURLForAlias(aid)
462 >>> re.search(r'^http://localhost:58000/\d+/hot%20dog$', url) is not None469 >>> re.search(r'/\d+/hot%20dog$', url) is not None
463 True470 True
464471
465Unicode file names work. Note that the filename in the resulting URL472Unicode file names work. Note that the filename in the resulting URL
@@ -472,7 +479,7 @@
472 >>> f.read()479 >>> f.read()
473 'This is some data'480 'This is some data'
474 >>> url = client.getURLForAlias(aid)481 >>> url = client.getURLForAlias(aid)
475 >>> re.search(r'^http://localhost:58000/\d+/Yow%E2%80%BD$', url) is not None482 >>> re.search(r'/\d+/Yow%E2%80%BD$', url) is not None
476 True483 True
477484
478Files will get garbage collected on production systems as per485Files will get garbage collected on production systems as per
479486
=== modified file 'lib/canonical/launchpad/doc/message.txt'
--- lib/canonical/launchpad/doc/message.txt 2010-10-18 22:24:59 +0000
+++ lib/canonical/launchpad/doc/message.txt 2011-01-19 13:41:53 +0000
@@ -175,8 +175,6 @@
175 >>> blob = chunks[1].blob175 >>> blob = chunks[1].blob
176 >>> blob.filename176 >>> blob.filename
177 u'anna.jpg.exe'177 u'anna.jpg.exe'
178 >>> blob.http_url.startswith(u'http://localhost:58000/')
179 True
180 >>> blob.http_url.endswith(u'/anna.jpg.exe')178 >>> blob.http_url.endswith(u'/anna.jpg.exe')
181 True179 True
182180
183181
=== modified file 'lib/canonical/launchpad/doc/old-testing.txt'
--- lib/canonical/launchpad/doc/old-testing.txt 2011-01-19 13:41:25 +0000
+++ lib/canonical/launchpad/doc/old-testing.txt 2011-01-19 13:41:53 +0000
@@ -153,7 +153,8 @@
153>>> from canonical.librarian.interfaces import ILibrarianClient153>>> from canonical.librarian.interfaces import ILibrarianClient
154>>> from StringIO import StringIO154>>> from StringIO import StringIO
155155
156>>> librarian = LibrarianServerFixture()156>>> from canonical.testing.layers import BaseLayer
157>>> librarian = LibrarianServerFixture(BaseLayer.config_fixture)
157>>> librarian.setUp()158>>> librarian.setUp()
158>>> login(ANONYMOUS)159>>> login(ANONYMOUS)
159160
160161
=== modified file 'lib/canonical/launchpad/pagetests/webservice/xx-hostedfile.txt'
--- lib/canonical/launchpad/pagetests/webservice/xx-hostedfile.txt 2009-04-17 10:32:16 +0000
+++ lib/canonical/launchpad/pagetests/webservice/xx-hostedfile.txt 2011-01-19 13:41:53 +0000
@@ -57,21 +57,21 @@
57 >>> print result57 >>> print result
58 HTTP/1.1 303 See Other58 HTTP/1.1 303 See Other
59 ...59 ...
60 Location: http://localhost:58000/.../icon60 Location: http://.../icon
61 ...61 ...
6262
63 >>> result = webservice.get(project['logo_link'])63 >>> result = webservice.get(project['logo_link'])
64 >>> print result64 >>> print result
65 HTTP/1.1 303 See Other65 HTTP/1.1 303 See Other
66 ...66 ...
67 Location: http://localhost:58000/.../logo67 Location: http://.../logo
68 ...68 ...
6969
70 >>> result = webservice.get(project['brand_link'])70 >>> result = webservice.get(project['brand_link'])
71 >>> print result71 >>> print result
72 HTTP/1.1 303 See Other72 HTTP/1.1 303 See Other
73 ...73 ...
74 Location: http://localhost:58000/.../brand74 Location: http://.../brand
75 ...75 ...
7676
7777
7878
=== modified file 'lib/canonical/launchpad/scripts/ftests/librarianformatter.txt'
--- lib/canonical/launchpad/scripts/ftests/librarianformatter.txt 2010-11-06 12:50:22 +0000
+++ lib/canonical/launchpad/scripts/ftests/librarianformatter.txt 2011-01-19 13:41:53 +0000
@@ -72,10 +72,10 @@
72>>> librarian_log.error('Oops', exc_info=exception)72>>> librarian_log.error('Oops', exc_info=exception)
73>>> print librarian_out.getvalue()73>>> print librarian_out.getvalue()
74ERROR Oops74ERROR Oops
75 -> http://localhost:58000/...txt (An Exception)75 -> http://.../....txt (An Exception)
76>>> url = librarian_out.getvalue().splitlines()[-1].split()[1:2][0]76>>> url = librarian_out.getvalue().splitlines()[-1].split()[1:2][0]
77>>> print url77>>> print url
78http://localhost:58000/...txt78http://.../....txt
79>>> print urlopen(url).read()79>>> print urlopen(url).read()
80Traceback (most recent call last):80Traceback (most recent call last):
81 ...81 ...
@@ -116,9 +116,9 @@
116... librarian_log.exception('Dud2')116... librarian_log.exception('Dud2')
117>>> print librarian_out.getvalue()117>>> print librarian_out.getvalue()
118ERROR Dud1118ERROR Dud1
119 -> http://localhost:58000/...txt (Dud)119 -> http://.../....txt (Dud)
120ERROR Dud2120ERROR Dud2
121 -> http://localhost:58000/...txt (Dud)121 -> http://.../....txt (Dud)
122<BLANKLINE>122<BLANKLINE>
123123
124The end result of this is to not have scripts display exceptions to124The end result of this is to not have scripts display exceptions to
@@ -134,8 +134,8 @@
134>>> print out134>>> print out
135Script Output135Script Output
136ERROR Oops136ERROR Oops
137 -> http://localhost:58000/...txt (Aargh)137 -> http://.../....txt (Aargh)
138ERROR Root oops138ERROR Root oops
139 -> http://localhost:58000/...txt (Aargh)139 -> http://.../....txt (Aargh)
140140
141141
142142
=== modified file 'lib/canonical/librarian/ftests/test_web.py'
--- lib/canonical/librarian/ftests/test_web.py 2010-11-06 12:50:22 +0000
+++ lib/canonical/librarian/ftests/test_web.py 2011-01-19 13:41:53 +0000
@@ -149,23 +149,12 @@
149 url = client.getURLForAlias(aid)149 url = client.getURLForAlias(aid)
150 self.assertEqual(urlopen(url).read(), 'sample')150 self.assertEqual(urlopen(url).read(), 'sample')
151151
152 old_url = 'http://%s:%d/42/%d/%s' % (152 old_url = url.replace(str(aid), '42/%d' % aid)
153 config.librarian.download_host,
154 config.librarian.download_port,
155 aid, filename)
156 self.assertEqual(urlopen(old_url).read(), 'sample')153 self.assertEqual(urlopen(old_url).read(), 'sample')
157154
158 # If the content id is not an integer, a 404 is raised155 # If the content id is not an integer, a 404 is raised
159 old_url = 'http://%s:%d/foo/%d/%s' % (156 old_url = url.replace(str(aid), 'foo/%d' % aid)
160 config.librarian.download_host,157 self.require404(old_url)
161 config.librarian.download_port,
162 aid, filename)
163 self.require404(self._makeURL(aid, 'different.txt'))
164
165 def _makeURL(self, aliasID, filename):
166 host = config.librarian.download_host
167 port = config.librarian.download_port
168 return 'http://%s:%d/%d/%s' % (host, port, aliasID, filename)
169158
170 def test_404(self):159 def test_404(self):
171 client = LibrarianClient()160 client = LibrarianClient()
@@ -175,13 +164,13 @@
175 url = client.getURLForAlias(aid)164 url = client.getURLForAlias(aid)
176 self.assertEqual(urlopen(url).read(), 'sample')165 self.assertEqual(urlopen(url).read(), 'sample')
177166
178 # Ensure our helper is working
179 self.failUnlessEqual(url, self._makeURL(aid, filename))
180
181 # Change the aliasid and assert we get a 404167 # Change the aliasid and assert we get a 404
182 self.require404(self._makeURL(aid+1, filename))168 self.failUnless(str(aid) in url)
169 self.require404(url.replace(str(aid), str(aid+1)))
170
183 # Change the filename and assert we get a 404171 # Change the filename and assert we get a 404
184 self.require404(self._makeURL(aid, 'different.txt'))172 self.failUnless(str(filename) in url)
173 self.require404(url.replace(filename, 'different.txt'))
185174
186 def test_duplicateuploads(self):175 def test_duplicateuploads(self):
187 client = LibrarianClient()176 client = LibrarianClient()
@@ -284,7 +273,7 @@
284 connection.request("GET", path, headers={'Host': good_host})273 connection.request("GET", path, headers={'Host': good_host})
285 response = connection.getresponse()274 response = connection.getresponse()
286 response.read()275 response.read()
287 self.assertEqual(200, response.status)276 self.assertEqual(200, response.status, response)
288 # A subdomain based URL trying to put fileAlias into the restricted277 # A subdomain based URL trying to put fileAlias into the restricted
289 # domain of fileAlias2 must not work.278 # domain of fileAlias2 must not work.
290 hostile_host = template_host % fileAlias2279 hostile_host = template_host % fileAlias2
291280
=== modified file 'lib/canonical/librarian/testing/server.py'
--- lib/canonical/librarian/testing/server.py 2011-01-19 13:41:25 +0000
+++ lib/canonical/librarian/testing/server.py 2011-01-19 13:41:53 +0000
@@ -44,11 +44,18 @@
44 :ivar pid: pid of the external process.44 :ivar pid: pid of the external process.
45 """45 """
4646
47 def __init__(self):47 def __init__(self, config_fixture):
48 """Initialize the LibrarianServerFixture.
49
50 :param config_fixture: The ConfigFixture in use by our tests.
51 In the layered environment, this is
52 BaseLayer.config_fixture.
53 """
48 Fixture.__init__(self)54 Fixture.__init__(self)
49 self._pid = None55 self._pid = None
50 # Track whether the fixture has been setup or not.56 # Track whether the fixture has been setup or not.
51 self._setup = False57 self._setup = False
58 self.config_fixture = config_fixture
5259
53 def setUp(self):60 def setUp(self):
54 """Start both librarian instances."""61 """Start both librarian instances."""
@@ -69,6 +76,11 @@
69 self._setup = True76 self._setup = True
70 self.addCleanup(setattr, self, '_setup', False)77 self.addCleanup(setattr, self, '_setup', False)
7178
79 # Update the config our tests are using to know about the
80 # correct ports.
81 self.config_fixture.add_section(self.service_config)
82 config.reloadConfig()
83
72 def cleanUp(self):84 def cleanUp(self):
73 """Shut downs both librarian instances."""85 """Shut downs both librarian instances."""
74 if self._persistent_servers():86 if self._persistent_servers():
@@ -164,17 +176,19 @@
164 [librarian]176 [librarian]
165 download_port: %s177 download_port: %s
166 upload_port: %s178 upload_port: %s
167 download_url: http://launchpad.dev:%s/179 download_url: http://%s:%s/
168 restricted_download_port: %s180 restricted_download_port: %s
169 restricted_upload_port: %s181 restricted_upload_port: %s
170 restricted_download_url: http://launchpad_dev:%s/182 restricted_download_url: http://%s:%s/
171 """) % (183 """) % (
172 self.root,184 self.root,
173 self.download_port,185 self.download_port,
174 self.upload_port,186 self.upload_port,
187 config.librarian.download_host,
175 self.download_port,188 self.download_port,
176 self.restricted_download_port,189 self.restricted_download_port,
177 self.restricted_upload_port,190 self.restricted_upload_port,
191 config.librarian.restricted_download_host,
178 self.restricted_download_port,192 self.restricted_download_port,
179 )193 )
180194
181195
=== modified file 'lib/canonical/librarian/testing/tests/test_server_fixture.py'
--- lib/canonical/librarian/testing/tests/test_server_fixture.py 2011-01-19 13:41:25 +0000
+++ lib/canonical/librarian/testing/tests/test_server_fixture.py 2011-01-19 13:41:53 +0000
@@ -16,6 +16,7 @@
16from testtools.content_type import UTF8_TEXT16from testtools.content_type import UTF8_TEXT
1717
18from canonical.config import config18from canonical.config import config
19from canonical.config.fixture import ConfigFixture
19from canonical.librarian.testing.server import LibrarianServerFixture20from canonical.librarian.testing.server import LibrarianServerFixture
20from canonical.testing.ftests.test_layers import (21from canonical.testing.ftests.test_layers import (
21 BaseLayerIsolator,22 BaseLayerIsolator,
@@ -34,12 +35,20 @@
34 self.skip('persistent server running.')35 self.skip('persistent server running.')
3536
36 def test_on_init_no_pid(self):37 def test_on_init_no_pid(self):
37 fixture = LibrarianServerFixture()38 fixture = LibrarianServerFixture(BaseLayer.config_fixture)
38 self.skip_if_persistent(fixture)39 self.skip_if_persistent(fixture)
39 self.assertEqual(None, fixture.pid)40 self.assertEqual(None, fixture.pid)
4041
41 def test_setUp_allocates_resources(self):42 def test_setUp_allocates_resources(self):
42 fixture = LibrarianServerFixture()43 # We need a new ConfigFixture, and create a
44 # LibrarianServerFixture using it. We can then confirm that new
45 # resources have been allocated by comparing with the currently
46 # in use ConfigFixture and config.
47 config_fixture = ConfigFixture(
48 'foo', BaseLayer.config_fixture.instance_name)
49 self.addCleanup(config_fixture.cleanUp)
50 config_fixture.setUp()
51 fixture = LibrarianServerFixture(config_fixture)
43 self.skip_if_persistent(fixture)52 self.skip_if_persistent(fixture)
44 with fixture:53 with fixture:
45 try:54 try:
@@ -63,17 +72,19 @@
63 [librarian]72 [librarian]
64 download_port: %s73 download_port: %s
65 upload_port: %s74 upload_port: %s
66 download_url: http://launchpad.dev:%s/75 download_url: http://%s:%s/
67 restricted_download_port: %s76 restricted_download_port: %s
68 restricted_upload_port: %s77 restricted_upload_port: %s
69 restricted_download_url: http://launchpad_dev:%s/78 restricted_download_url: http://%s:%s/
70 """) % (79 """) % (
71 fixture.root,80 fixture.root,
72 fixture.download_port,81 fixture.download_port,
73 fixture.upload_port,82 fixture.upload_port,
83 config.librarian.download_host,
74 fixture.download_port,84 fixture.download_port,
75 fixture.restricted_download_port,85 fixture.restricted_download_port,
76 fixture.restricted_upload_port,86 fixture.restricted_upload_port,
87 config.librarian.restricted_download_host,
77 fixture.restricted_download_port,88 fixture.restricted_download_port,
78 )89 )
79 self.assertEqual(expected_config, fixture.service_config)90 self.assertEqual(expected_config, fixture.service_config)
@@ -82,7 +93,7 @@
82 raise93 raise
8394
84 def test_getLogChunks(self):95 def test_getLogChunks(self):
85 fixture = LibrarianServerFixture()96 fixture = LibrarianServerFixture(BaseLayer.config_fixture)
86 with fixture:97 with fixture:
87 chunks = fixture.getLogChunks()98 chunks = fixture.getLogChunks()
88 self.assertIsInstance(chunks, list)99 self.assertIsInstance(chunks, list)
@@ -96,7 +107,7 @@
96 # Avoid indefinite hangs:107 # Avoid indefinite hangs:
97 self.addCleanup(socket.setdefaulttimeout, socket.getdefaulttimeout())108 self.addCleanup(socket.setdefaulttimeout, socket.getdefaulttimeout())
98 socket.setdefaulttimeout(1)109 socket.setdefaulttimeout(1)
99 fixture = LibrarianServerFixture()110 fixture = LibrarianServerFixture(BaseLayer.config_fixture)
100 with fixture:111 with fixture:
101 librarian_url = "http://%s:%d" % (112 librarian_url = "http://%s:%d" % (
102 config.librarian.download_host,113 config.librarian.download_host,
103114
=== modified file 'lib/canonical/testing/ftests/test_layers.py'
--- lib/canonical/testing/ftests/test_layers.py 2011-01-19 13:41:25 +0000
+++ lib/canonical/testing/ftests/test_layers.py 2011-01-19 13:41:53 +0000
@@ -55,7 +55,7 @@
5555
56class BaseLayerIsolator(Fixture):56class BaseLayerIsolator(Fixture):
57 """A fixture for isolating BaseLayer.57 """A fixture for isolating BaseLayer.
58 58
59 This is useful to test interactions with LP_PERSISTENT_TEST_SERVICES 59 This is useful to test interactions with LP_PERSISTENT_TEST_SERVICES
60 which makes tests within layers unable to test that easily.60 which makes tests within layers unable to test that easily.
61 """61 """
@@ -113,7 +113,7 @@
113 self.assertEqual(None, os.environ.get('LP_TEST_INSTANCE'))113 self.assertEqual(None, os.environ.get('LP_TEST_INSTANCE'))
114114
115 def test_persist_test_services_disables_LP_TEST_INSTANCE(self):115 def test_persist_test_services_disables_LP_TEST_INSTANCE(self):
116 self.useFixture(BaseLayerIsolator())116 self.useFixture(BaseLayerIsolator(with_persistent=True))
117 with LayerFixture(BaseLayer):117 with LayerFixture(BaseLayer):
118 self.assertEqual(None, os.environ.get('LP_TEST_INSTANCE'))118 self.assertEqual(None, os.environ.get('LP_TEST_INSTANCE'))
119 self.assertEqual(None, os.environ.get('LP_TEST_INSTANCE'))119 self.assertEqual(None, os.environ.get('LP_TEST_INSTANCE'))
120120
=== modified file 'lib/canonical/testing/layers.py'
--- lib/canonical/testing/layers.py 2011-01-19 13:41:25 +0000
+++ lib/canonical/testing/layers.py 2011-01-19 13:41:53 +0000
@@ -820,12 +820,16 @@
820 "_reset_between_tests changed before LibrarianLayer "820 "_reset_between_tests changed before LibrarianLayer "
821 "was actually used."821 "was actually used."
822 )822 )
823 cls.librarian_fixture = LibrarianServerFixture()823 cls.librarian_fixture = LibrarianServerFixture(
824 BaseLayer.config_fixture)
824 cls.librarian_fixture.setUp()825 cls.librarian_fixture.setUp()
825 BaseLayer.config.add_section(cls.librarian_fixture.service_config)
826 config.reloadConfig()
827 cls._check_and_reset()826 cls._check_and_reset()
828827
828 # Make sure things using the appserver config know the
829 # correct Librarian port numbers.
830 cls.appserver_config_fixture.add_section(
831 cls.librarian_fixture.service_config)
832
829 @classmethod833 @classmethod
830 @profiled834 @profiled
831 def tearDown(cls):835 def tearDown(cls):
@@ -841,9 +845,8 @@
841 try:845 try:
842 if not cls._reset_between_tests:846 if not cls._reset_between_tests:
843 raise LayerInvariantError(847 raise LayerInvariantError(
844 "_reset_between_tests not reset before LibrarianLayer "848 "_reset_between_tests not reset before "
845 "shutdown"849 "LibrarianLayer shutdown")
846 )
847 finally:850 finally:
848 librarian.cleanUp()851 librarian.cleanUp()
849852
@@ -947,7 +950,7 @@
947 @profiled950 @profiled
948 def tearDown(cls):951 def tearDown(cls):
949 pass952 pass
950 953
951 @classmethod954 @classmethod
952 @profiled955 @profiled
953 def testSetUp(cls):956 def testSetUp(cls):
954957
=== modified file 'lib/lp/bugs/browser/tests/test_bugattachment_file_access.py'
--- lib/lp/bugs/browser/tests/test_bugattachment_file_access.py 2011-01-06 11:49:00 +0000
+++ lib/lp/bugs/browser/tests/test_bugattachment_file_access.py 2011-01-19 13:41:53 +0000
@@ -88,7 +88,7 @@
88 next_view, traversal_path = view.browserDefault(request)88 next_view, traversal_path = view.browserDefault(request)
89 self.assertIsInstance(next_view, RedirectionView)89 self.assertIsInstance(next_view, RedirectionView)
90 mo = re.match(90 mo = re.match(
91 '^http://localhost:58000/\d+/foo.txt$', next_view.target)91 '^http://.*/\d+/foo.txt$', next_view.target)
92 self.assertIsNot(None, mo)92 self.assertIsNot(None, mo)
9393
94 def test_access_to_restricted_file(self):94 def test_access_to_restricted_file(self):
@@ -213,13 +213,13 @@
213 self.assertEqual(303, response.status)213 self.assertEqual(303, response.status)
214214
215 # The Librarian URL has, for our test case, the form215 # The Librarian URL has, for our test case, the form
216 # "https://NNNN.restricted.localhost:58000/NNNN/foo.txt?token=..."216 # "https://NNNN.restricted.launchpad.dev:PORT/NNNN/foo.txt?token=..."
217 # where NNNN is an integer.217 # where NNNN and PORT are integers.
218 parsed_url = urlparse(response.getHeader('location'))218 parsed_url = urlparse(response.getHeader('location'))
219 self.assertEqual('https', parsed_url.scheme)219 self.assertEqual('https', parsed_url.scheme)
220 mo = re.search(220 mo = re.search(
221 r'^i\d+\.restricted\.localhost:58000$', parsed_url.netloc)221 r'^i\d+\.restricted\..+:\d+$', parsed_url.netloc)
222 self.assertIsNot(None, mo)222 self.assertIsNot(None, mo, parsed_url.netloc)
223 mo = re.search(r'^/\d+/foo\.txt$', parsed_url.path)223 mo = re.search(r'^/\d+/foo\.txt$', parsed_url.path)
224 self.assertIsNot(None, mo)224 self.assertIsNot(None, mo)
225 params = parse_qs(parsed_url.query)225 params = parse_qs(parsed_url.query)
226226
=== modified file 'lib/lp/bugs/stories/webservice/xx-bug.txt'
--- lib/lp/bugs/stories/webservice/xx-bug.txt 2010-12-20 17:42:47 +0000
+++ lib/lp/bugs/stories/webservice/xx-bug.txt 2011-01-19 13:41:53 +0000
@@ -1278,7 +1278,7 @@
1278 HTTP/1.1 303 See Other...1278 HTTP/1.1 303 See Other...
1279 Content-Length: 01279 Content-Length: 0
1280 Content-Type: text/plain1280 Content-Type: text/plain
1281 Location: http://localhost:58000/.../numbers.txt1281 Location: http://.../numbers.txt
1282 ...1282 ...
12831283
1284 >>> from urllib2 import urlopen1284 >>> from urllib2 import urlopen
12851285
=== modified file 'lib/lp/code/stories/branches/xx-person-portlet-teambranches.txt'
--- lib/lp/code/stories/branches/xx-person-portlet-teambranches.txt 2010-04-20 04:14:18 +0000
+++ lib/lp/code/stories/branches/xx-person-portlet-teambranches.txt 2011-01-19 13:41:53 +0000
@@ -36,6 +36,6 @@
36 Branches owned by36 Branches owned by
37 >>> print tb.li37 >>> print tb.li
38 <li>38 <li>
39 <img src="http://localhost:58000/.../vikings.png" width="14" height="14" />39 <img src="http://.../vikings.png" width="14" height="14" />
40 <a href="/~vikings">Vikings</a>40 <a href="/~vikings">Vikings</a>
41 </li>41 </li>
4242
=== modified file 'lib/lp/hardwaredb/stories/hwdb/02-view-submissions.txt'
--- lib/lp/hardwaredb/stories/hwdb/02-view-submissions.txt 2010-02-02 17:12:29 +0000
+++ lib/lp/hardwaredb/stories/hwdb/02-view-submissions.txt 2011-01-19 13:41:53 +0000
@@ -28,7 +28,7 @@
2828
29 >>> download_link = anon_browser.getLink('test.txt')29 >>> download_link = anon_browser.getLink('test.txt')
30 >>> download_link.url30 >>> download_link.url
31 'http://localhost:58000/.../test.txt'31 'http://.../test.txt'
3232
33 >>> raw_link = anon_browser.getLink('text')33 >>> raw_link = anon_browser.getLink('text')
34 >>> raw_link.url34 >>> raw_link.url
@@ -158,7 +158,7 @@
158 Distribution-Series: 5.04158 Distribution-Series: 5.04
159 Architecture: i386159 Architecture: i386
160 System: Fujitsu_CY26160 System: Fujitsu_CY26
161 Submission URL: http://localhost:58000/.../test.txt161 Submission URL: http://.../test.txt
162162
163Private submissions can't be viewed anonymously:163Private submissions can't be viewed anonymously:
164164
@@ -181,7 +181,7 @@
181 Distribution-Series: 5.04181 Distribution-Series: 5.04
182 Architecture: i386182 Architecture: i386
183 System: Black Box 42183 System: Black Box 42
184 Submission URL: http://localhost:58000/.../teamtest.txt184 Submission URL: http://.../teamtest.txt
185185
186186
187== Submissions listed by fingerprint ==187== Submissions listed by fingerprint ==
188188
=== modified file 'lib/lp/hardwaredb/stories/webservice/xx-hwdb.txt'
--- lib/lp/hardwaredb/stories/webservice/xx-hwdb.txt 2010-02-02 17:12:29 +0000
+++ lib/lp/hardwaredb/stories/webservice/xx-hwdb.txt 2011-01-19 13:41:53 +0000
@@ -540,7 +540,7 @@
540 HTTP/1.1 303 See Other...540 HTTP/1.1 303 See Other...
541 Content-Length: 0541 Content-Length: 0
542 Content-Type: text/plain542 Content-Type: text/plain
543 Location: http://localhost:58000/92/sample-submission-2.xml543 Location: http://.../92/sample-submission-2.xml
544 ...544 ...
545545
546A 404 error is returned when a client tries to access a non-existent546A 404 error is returned when a client tries to access a non-existent
547547
=== modified file 'lib/lp/registry/stories/product/xx-product-files.txt'
--- lib/lp/registry/stories/product/xx-product-files.txt 2010-09-24 20:49:42 +0000
+++ lib/lp/registry/stories/product/xx-product-files.txt 2011-01-19 13:41:53 +0000
@@ -516,7 +516,7 @@
516 >>> location = redirect_resp.getOutput().split("\n")[3]516 >>> location = redirect_resp.getOutput().split("\n")[3]
517 >>> redirect_url = location.split()[1]517 >>> redirect_url = location.split()[1]
518 >>> print redirect_url518 >>> print redirect_url
519 https://localhost:58000/.../foo.txt519 https://.../foo.txt
520520
521However if the original scheme is http then the redirect URL should be521However if the original scheme is http then the redirect URL should be
522over http.522over http.
@@ -528,7 +528,7 @@
528 >>> location = redirect_resp.getOutput().split("\n")[3]528 >>> location = redirect_resp.getOutput().split("\n")[3]
529 >>> redirect_url = location.split()[1]529 >>> redirect_url = location.split()[1]
530 >>> print redirect_url530 >>> print redirect_url
531 http://localhost:58000/.../foo.txt531 http://.../foo.txt
532532
533When 'use_https' is False the result will always be http.533When 'use_https' is False the result will always be http.
534534
@@ -548,7 +548,7 @@
548 >>> location = redirect_resp.getOutput().split("\n")[3]548 >>> location = redirect_resp.getOutput().split("\n")[3]
549 >>> redirect_url = location.split()[1]549 >>> redirect_url = location.split()[1]
550 >>> print redirect_url550 >>> print redirect_url
551 http://localhost:58000/.../foo.txt551 http://.../foo.txt
552552
553 >>> redirect_resp = http(dedent("""\553 >>> redirect_resp = http(dedent("""\
554 ... GET %s HTTP/1.1554 ... GET %s HTTP/1.1
@@ -557,7 +557,7 @@
557 >>> location = redirect_resp.getOutput().split("\n")[3]557 >>> location = redirect_resp.getOutput().split("\n")[3]
558 >>> redirect_url = location.split()[1]558 >>> redirect_url = location.split()[1]
559 >>> print redirect_url559 >>> print redirect_url
560 http://localhost:58000/.../foo.txt560 http://.../foo.txt
561561
562Return 'use_https' to its original value to not mess up future tests.562Return 'use_https' to its original value to not mess up future tests.
563563
564564
=== modified file 'lib/lp/registry/stories/webservice/xx-project-registry.txt'
--- lib/lp/registry/stories/webservice/xx-project-registry.txt 2010-11-22 21:36:21 +0000
+++ lib/lp/registry/stories/webservice/xx-project-registry.txt 2011-01-19 13:41:53 +0000
@@ -1112,7 +1112,7 @@
1112 >>> print result1112 >>> print result
1113 HTTP/1.1 303 See Other1113 HTTP/1.1 303 See Other
1114 ...1114 ...
1115 Location: http://localhost:58000/.../firefox_0.9.2.orig.tar.gz1115 Location: http://.../firefox_0.9.2.orig.tar.gz
1116 ...1116 ...
11171117
1118The signature file will redirect too, if found. In this case there is1118The signature file will redirect too, if found. In this case there is
@@ -1207,7 +1207,7 @@
1207 >>> print result1207 >>> print result
1208 HTTP/1.1 303 See Other1208 HTTP/1.1 303 See Other
1209 ...1209 ...
1210 Location: http://localhost:58000/.../filename.txt1210 Location: http://.../filename.txt
1211 ...1211 ...
12121212
1213Project release files can be deleted using the 'delete' method. The1213Project release files can be deleted using the 'delete' method. The
12141214
=== modified file 'lib/lp/registry/tests/test_distroseriesdifference.py'
--- lib/lp/registry/tests/test_distroseriesdifference.py 2010-10-29 19:28:14 +0000
+++ lib/lp/registry/tests/test_distroseriesdifference.py 2011-01-19 13:41:53 +0000
@@ -540,8 +540,7 @@
540 naked_dsdiff.parent_package_diff = self.factory.makePackageDiff()540 naked_dsdiff.parent_package_diff = self.factory.makePackageDiff()
541541
542 self.assertEqual(None, ds_diff.package_diff_url)542 self.assertEqual(None, ds_diff.package_diff_url)
543 self.assertTrue(ds_diff.parent_package_diff_url.startswith(543 self.assertTrue(ds_diff.parent_package_diff_url is not None)
544 'http://localhost:58000/'))
545544
546545
547class DistroSeriesDifferenceSourceTestCase(TestCaseWithFactory):546class DistroSeriesDifferenceSourceTestCase(TestCaseWithFactory):
548547
=== modified file 'lib/lp/soyuz/doc/distroarchseries.txt'
--- lib/lp/soyuz/doc/distroarchseries.txt 2010-11-02 21:44:42 +0000
+++ lib/lp/soyuz/doc/distroarchseries.txt 2011-01-19 13:41:53 +0000
@@ -367,7 +367,7 @@
367the file.367the file.
368368
369 >>> print hoary.getDistroArchSeries('hppa').chroot_url369 >>> print hoary.getDistroArchSeries('hppa').chroot_url
370 http://localhost:58000/.../filename...370 http://.../filename...
371 >>> hoary.getDistroArchSeries('hppa').chroot_url == \371 >>> hoary.getDistroArchSeries('hppa').chroot_url == \
372 ... chroot.http_url372 ... chroot.http_url
373 True373 True
374374
=== modified file 'lib/lp/soyuz/doc/soyuz-files.txt'
--- lib/lp/soyuz/doc/soyuz-files.txt 2010-10-19 18:44:31 +0000
+++ lib/lp/soyuz/doc/soyuz-files.txt 2011-01-19 13:41:53 +0000
@@ -48,7 +48,7 @@
48 u'firefox_0.9.2.orig.tar.gz'48 u'firefox_0.9.2.orig.tar.gz'
4949
50 >>> srcfile.libraryfile.http_url50 >>> srcfile.libraryfile.http_url
51 'http://localhost:58000/3/firefox_0.9.2.orig.tar.gz'51 'http://.../3/firefox_0.9.2.orig.tar.gz'
5252
5353
54== Binary Files ==54== Binary Files ==
@@ -76,7 +76,7 @@
76 u'pmount_1.9-1_all.deb'76 u'pmount_1.9-1_all.deb'
7777
78 >>> debfile.libraryfile.http_url78 >>> debfile.libraryfile.http_url
79 'http://localhost:58000/37/pmount_1.9-1_all.deb'79 'http://.../37/pmount_1.9-1_all.deb'
8080
8181
82== Utilities ==82== Utilities ==
8383
=== modified file 'lib/lp/soyuz/stories/ppa/xx-ppa-files.txt'
--- lib/lp/soyuz/stories/ppa/xx-ppa-files.txt 2011-01-12 23:07:40 +0000
+++ lib/lp/soyuz/stories/ppa/xx-ppa-files.txt 2011-01-19 13:41:53 +0000
@@ -350,14 +350,14 @@
350 >>> logout()350 >>> logout()
351351
352 >>> print file_librarian_url352 >>> print file_librarian_url
353 http://localhost:58000/.../test-pkg_1.0.dsc353 http://.../test-pkg_1.0.dsc
354354
355 >>> print http(r"""355 >>> print http(r"""
356 ... GET %s HTTP/1.1356 ... GET %s HTTP/1.1
357 ... """ % file_lp_url.replace('http://launchpad.dev', ''))357 ... """ % file_lp_url.replace('http://launchpad.dev', ''))
358 HTTP/1.1 303 See Other358 HTTP/1.1 303 See Other
359 ...359 ...
360 Location: http://localhost:58000/.../test-pkg_1.0.dsc360 Location: http://.../test-pkg_1.0.dsc
361 ...361 ...
362362
363363
364364
=== modified file 'lib/lp/soyuz/stories/soyuz/xx-distro-package-pages.txt'
--- lib/lp/soyuz/stories/soyuz/xx-distro-package-pages.txt 2009-09-03 16:53:49 +0000
+++ lib/lp/soyuz/stories/soyuz/xx-distro-package-pages.txt 2011-01-19 13:41:53 +0000
@@ -47,5 +47,5 @@
47 ... """ % path)47 ... """ % path)
48 HTTP/1.1 303 See Other48 HTTP/1.1 303 See Other
49 ...49 ...
50 Location: http://localhost:58000/68/commercialpackage_1.0-1.dsc50 Location: http://.../68/commercialpackage_1.0-1.dsc
51 ...51 ...
5252
=== modified file 'lib/lp/soyuz/stories/soyuz/xx-distroarchseries-binpackages.txt'
--- lib/lp/soyuz/stories/soyuz/xx-distroarchseries-binpackages.txt 2009-12-11 15:27:08 +0000
+++ lib/lp/soyuz/stories/soyuz/xx-distroarchseries-binpackages.txt 2011-01-19 13:41:53 +0000
@@ -107,7 +107,7 @@
107 >>> dfiles_element = find_tag_by_id(107 >>> dfiles_element = find_tag_by_id(
108 ... browser.contents, 'downloadable-files')108 ... browser.contents, 'downloadable-files')
109 >>> print dfiles_element.find(name='a')['href']109 >>> print dfiles_element.find(name='a')['href']
110 http://localhost:58000/40/mozilla-firefox_0.9_i386.deb110 http://.../40/mozilla-firefox_0.9_i386.deb
111111
112If the binary package did produce files, but those files have been112If the binary package did produce files, but those files have been
113subsequently deleted, this will also be indicated and the file will113subsequently deleted, this will also be indicated and the file will
114114
=== modified file 'lib/lp/soyuz/stories/soyuz/xx-distroseries-sources.txt'
--- lib/lp/soyuz/stories/soyuz/xx-distroseries-sources.txt 2010-11-11 21:48:20 +0000
+++ lib/lp/soyuz/stories/soyuz/xx-distroseries-sources.txt 2011-01-19 13:41:53 +0000
@@ -387,7 +387,7 @@
387With the possibility to download the entire changesfile (if available):387With the possibility to download the entire changesfile (if available):
388388
389 >>> print browser.getLink('View changes file').url389 >>> print browser.getLink('View changes file').url
390 http://localhost:58000/65/commercialpackage_1.0-1_source.changes390 http://.../65/commercialpackage_1.0-1_source.changes
391391
392And also download the files contained in this source, like '.orig',392And also download the files contained in this source, like '.orig',
393'.diff' and the DSC:393'.diff' and the DSC:
394394
=== modified file 'lib/lp/soyuz/stories/soyuz/xx-queue-pages-delayed-copies.txt'
--- lib/lp/soyuz/stories/soyuz/xx-queue-pages-delayed-copies.txt 2010-10-18 22:24:59 +0000
+++ lib/lp/soyuz/stories/soyuz/xx-queue-pages-delayed-copies.txt 2011-01-19 13:41:53 +0000
@@ -122,7 +122,7 @@
122 >>> anon_browser.getControl("Update").click()122 >>> anon_browser.getControl("Update").click()
123123
124 >>> print anon_browser.getLink('foo, foo').url124 >>> print anon_browser.getLink('foo, foo').url
125 http://localhost:58000/.../foo_666_source.changes125 http://.../.../foo_666_source.changes
126126
127 >>> extra_information = find_tags_by_class(127 >>> extra_information = find_tags_by_class(
128 ... anon_browser.contents, 'queue-%s' % delayed_copy.id)128 ... anon_browser.contents, 'queue-%s' % delayed_copy.id)
129129
=== modified file 'lib/lp/soyuz/stories/soyuz/xx-queue-pages.txt'
--- lib/lp/soyuz/stories/soyuz/xx-queue-pages.txt 2011-01-19 13:41:25 +0000
+++ lib/lp/soyuz/stories/soyuz/xx-queue-pages.txt 2011-01-19 13:41:53 +0000
@@ -229,11 +229,11 @@
229229
230 >>> for row in filelist:230 >>> for row in filelist:
231 ... print row.find('a')231 ... print row.find('a')
232 <a href="http://localhost:58000/.../alsa-utils_1.0.9a-4ubuntu1.dsc">232 <a href="http://.../alsa-utils_1.0.9a-4ubuntu1.dsc">
233 alsa-utils_1.0.9a-4ubuntu1.dsc233 alsa-utils_1.0.9a-4ubuntu1.dsc
234 </a>234 </a>
235 None235 None
236 <a href="http://localhost:58000/.../alsa-utils.diff.gz">diff from 1.0.9a-4 to 1.0.9a-4ubuntu1</a>236 <a href="http://.../alsa-utils.diff.gz">diff from 1.0.9a-4 to 1.0.9a-4ubuntu1</a>
237237
238On binary queue items we also present the stamp 'NEW' for files never238On binary queue items we also present the stamp 'NEW' for files never
239published in the archive (it helps archive admins when reviewing239published in the archive (it helps archive admins when reviewing
240240
=== modified file 'lib/lp/soyuz/stories/webservice/xx-distroarchseries.txt'
--- lib/lp/soyuz/stories/webservice/xx-distroarchseries.txt 2010-02-22 10:37:13 +0000
+++ lib/lp/soyuz/stories/webservice/xx-distroarchseries.txt 2011-01-19 13:41:53 +0000
@@ -34,7 +34,7 @@
34 >>> from lazr.restful.testing.webservice import pprint_entry34 >>> from lazr.restful.testing.webservice import pprint_entry
35 >>> pprint_entry(distroarchseries)35 >>> pprint_entry(distroarchseries)
36 architecture_tag: u'i386'36 architecture_tag: u'i386'
37 chroot_url: u'http://localhost:58000/.../filename...'37 chroot_url: u'http://.../.../filename...'
38 display_name: u'Ubuntu Hoary i386'38 display_name: u'Ubuntu Hoary i386'
39 distroseries_link: u'http://.../ubuntu/hoary'39 distroseries_link: u'http://.../ubuntu/hoary'
40 is_nominated_arch_indep: True40 is_nominated_arch_indep: True
4141
=== modified file 'lib/lp/soyuz/tests/test_publishing_models.py'
--- lib/lp/soyuz/tests/test_publishing_models.py 2010-10-04 19:50:45 +0000
+++ lib/lp/soyuz/tests/test_publishing_models.py 2011-01-19 13:41:53 +0000
@@ -82,9 +82,7 @@
82 self.publishing_set.getChangesFileLFA(hist.sourcepackagerelease)82 self.publishing_set.getChangesFileLFA(hist.sourcepackagerelease)
83 for hist in self.sources)83 for hist in self.sources)
84 urls = [lfa.http_url for lfa in lfas]84 urls = [lfa.http_url for lfa in lfas]
85 self.assertEqual(urls, [85 self.assert_(urls[0].endswith('/94/gedit_666_source.changes'))
86 'http://localhost:58000/94/gedit_666_source.changes',86 self.assert_(urls[1].endswith('/96/firefox_666_source.changes'))
87 'http://localhost:58000/96/firefox_666_source.changes',87 self.assert_(urls[2].endswith(
88 ('http://localhost:58000/98/'88 '/98/getting-things-gnome_666_source.changes'))
89 'getting-things-gnome_666_source.changes'),
90 ])
9189
=== modified file 'lib/lp/testing/__init__.py'
--- lib/lp/testing/__init__.py 2011-01-19 13:41:25 +0000
+++ lib/lp/testing/__init__.py 2011-01-19 13:41:53 +0000
@@ -512,13 +512,8 @@
512 """Include the logChunks from fixture in the test details."""512 """Include the logChunks from fixture in the test details."""
513 # Evaluate the log when called, not later, to permit the librarian to513 # Evaluate the log when called, not later, to permit the librarian to
514 # be shutdown before the detail is rendered.514 # be shutdown before the detail is rendered.
515<<<<<<< TREE515 chunks = fixture.getLogChunks()
516 chunks = fixture.logChunks()
517 content = Content(UTF8_TEXT, lambda: chunks)516 content = Content(UTF8_TEXT, lambda: chunks)
518=======
519 chunks = fixture.getLogChunks()
520 content = Content(UTF8_TEXT, lambda:chunks)
521>>>>>>> MERGE-SOURCE
522 self.addDetail('librarian-log', content)517 self.addDetail('librarian-log', content)
523518
524 def setUp(self):519 def setUp(self):
525520
=== modified file 'lib/lp/translations/doc/poexport-queue.txt'
--- lib/lp/translations/doc/poexport-queue.txt 2011-01-13 18:09:48 +0000
+++ lib/lp/translations/doc/poexport-queue.txt 2011-01-19 13:41:53 +0000
@@ -304,7 +304,7 @@
304 The translation files you requested from Launchpad are ready for304 The translation files you requested from Launchpad are ready for
305 download from the following location:305 download from the following location:
306 <BLANKLINE>306 <BLANKLINE>
307 http://localhost:58000/.../po_evolution-2.2.pot307 http://.../.../po_evolution-2.2.pot
308 <BLANKLINE>308 <BLANKLINE>
309 Note: this link will expire in about 1 week. If you want to309 Note: this link will expire in about 1 week. If you want to
310 download these translations again, you will have to request310 download these translations again, you will have to request
311311
=== modified file 'lib/lp/translations/doc/poexport-request-productseries.txt'
--- lib/lp/translations/doc/poexport-request-productseries.txt 2010-12-22 20:46:21 +0000
+++ lib/lp/translations/doc/poexport-request-productseries.txt 2011-01-19 13:41:53 +0000
@@ -60,7 +60,7 @@
60 The translation files you requested from Launchpad are ready for60 The translation files you requested from Launchpad are ready for
61 download from the following location:61 download from the following location:
62 <BLANKLINE>62 <BLANKLINE>
63 http://localhost:58000/.../launchpad-export.tar.gz63 http://.../launchpad-export.tar.gz
64 <BLANKLINE>64 <BLANKLINE>
65 Note: this link will expire in about 1 week. If you want to65 Note: this link will expire in about 1 week. If you want to
66 download these translations again, you will have to request66 download these translations again, you will have to request
6767
=== modified file 'lib/lp/translations/doc/poexport-request.txt'
--- lib/lp/translations/doc/poexport-request.txt 2010-12-22 20:46:21 +0000
+++ lib/lp/translations/doc/poexport-request.txt 2011-01-19 13:41:53 +0000
@@ -62,7 +62,7 @@
62 The translation files you requested from Launchpad are ready for62 The translation files you requested from Launchpad are ready for
63 download from the following location:63 download from the following location:
64 <BLANKLINE>64 <BLANKLINE>
65 http://localhost:58000/.../launchpad-export.tar.gz65 http://.../launchpad-export.tar.gz
66 <BLANKLINE>66 <BLANKLINE>
67 Note: this link will expire in about 1 week. If you want to67 Note: this link will expire in about 1 week. If you want to
68 download these translations again, you will have to request68 download these translations again, you will have to request
@@ -194,7 +194,7 @@
194 The translation files you requested from Launchpad are ready for194 The translation files you requested from Launchpad are ready for
195 download from the following location:195 download from the following location:
196 <BLANKLINE>196 <BLANKLINE>
197 http://localhost:58000/.../cs_LC_MESSAGES_pmount.mo197 http://.../cs_LC_MESSAGES_pmount.mo
198 <BLANKLINE>198 <BLANKLINE>
199 Note: this link will expire in about 1 week. If you want to199 Note: this link will expire in about 1 week. If you want to
200 download these translations again, you will have to request200 download these translations again, you will have to request
201201
=== modified file 'lib/lp/translations/doc/poimport-pofile-not-exported-from-rosetta.txt'
--- lib/lp/translations/doc/poimport-pofile-not-exported-from-rosetta.txt 2010-12-02 16:13:51 +0000
+++ lib/lp/translations/doc/poimport-pofile-not-exported-from-rosetta.txt 2011-01-19 13:41:53 +0000
@@ -118,7 +118,7 @@
118 apply your changes and upload the merged file.118 apply your changes and upload the merged file.
119 <BLANKLINE>119 <BLANKLINE>
120 For your convenience, you can get the file you uploaded at:120 For your convenience, you can get the file you uploaded at:
121 http://localhost:58000/.../firefox-cy.po121 http://.../firefox-cy.po
122 <BLANKLINE>122 <BLANKLINE>
123 Thank you,123 Thank you,
124 <BLANKLINE>124 <BLANKLINE>
125125
=== modified file 'lib/lp/translations/doc/poimport-pofile-old-po-imported.txt'
--- lib/lp/translations/doc/poimport-pofile-old-po-imported.txt 2010-12-02 16:13:51 +0000
+++ lib/lp/translations/doc/poimport-pofile-old-po-imported.txt 2011-01-19 13:41:53 +0000
@@ -177,7 +177,7 @@
177 'PO-Revision-Date' field updated.177 'PO-Revision-Date' field updated.
178 <BLANKLINE>178 <BLANKLINE>
179 For your convenience, you can get the file you uploaded at:179 For your convenience, you can get the file you uploaded at:
180 http://localhost:58000/.../firefox-cy.po180 http://.../firefox-cy.po
181 <BLANKLINE>181 <BLANKLINE>
182 Thank you,182 Thank you,
183 <BLANKLINE>183 <BLANKLINE>
184184
=== modified file 'lib/lp/translations/doc/poimport-pofile-syntax-error.txt'
--- lib/lp/translations/doc/poimport-pofile-syntax-error.txt 2010-12-02 16:13:51 +0000
+++ lib/lp/translations/doc/poimport-pofile-syntax-error.txt 2011-01-19 13:41:53 +0000
@@ -113,7 +113,7 @@
113 answer or file a question at https://answers.launchpad.net/rosetta/113 answer or file a question at https://answers.launchpad.net/rosetta/
114 <BLANKLINE>114 <BLANKLINE>
115 For your convenience, you can get the file you uploaded at:115 For your convenience, you can get the file you uploaded at:
116 http://localhost:58000/.../firefox-cy.po116 http://.../firefox-cy.po
117 <BLANKLINE>117 <BLANKLINE>
118 Thank you,118 Thank you,
119 <BLANKLINE>119 <BLANKLINE>
120120
=== modified file 'lib/lp/translations/doc/poimport-potemplate-syntax-error.txt'
--- lib/lp/translations/doc/poimport-potemplate-syntax-error.txt 2010-12-02 16:13:51 +0000
+++ lib/lp/translations/doc/poimport-potemplate-syntax-error.txt 2011-01-19 13:41:53 +0000
@@ -94,7 +94,7 @@
94 answer or file a question at https://answers.launchpad.net/rosetta/94 answer or file a question at https://answers.launchpad.net/rosetta/
95 <BLANKLINE>95 <BLANKLINE>
96 For your convenience, you can get the file you uploaded at:96 For your convenience, you can get the file you uploaded at:
97 http://localhost:58000/.../firefox.pot97 http://.../firefox.pot
98 <BLANKLINE>98 <BLANKLINE>
99 Thank you,99 Thank you,
100 <BLANKLINE>100 <BLANKLINE>
@@ -151,7 +151,7 @@
151 'ascii' codec can't decode byte ...151 'ascii' codec can't decode byte ...
152 <BLANKLINE>152 <BLANKLINE>
153 For your convenience, you can find the file you uploaded at:153 For your convenience, you can find the file you uploaded at:
154 http://localhost:58000/.../nonascii.pot154 http://.../nonascii.pot
155 <BLANKLINE>155 <BLANKLINE>
156 Thank you,156 Thank you,
157 <BLANKLINE>157 <BLANKLINE>
158158
=== modified file 'lib/lp/translations/stories/standalone/xx-translations-xpi-import.txt'
--- lib/lp/translations/stories/standalone/xx-translations-xpi-import.txt 2009-09-14 19:00:45 +0000
+++ lib/lp/translations/stories/standalone/xx-translations-xpi-import.txt 2011-01-19 13:41:53 +0000
@@ -36,7 +36,7 @@
3636
37 >>> browser.getLink('Translation Import Queue').click()37 >>> browser.getLink('Translation Import Queue').click()
38 >>> print browser.getLink(url='en-US.xpi').url38 >>> print browser.getLink(url='en-US.xpi').url
39 http://localhost:58000/.../en-US.xpi39 http://.../en-US.xpi
40 >>> browser.getLink(url='imports/3').click()40 >>> browser.getLink(url='imports/3').click()
41 >>> print browser.url41 >>> print browser.url
42 http://translations.launchpad.dev/+imports/342 http://translations.launchpad.dev/+imports/3