launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #01599
[Merge] lp:~wallyworld/launchpad/fix-hardcoded-test-urls into lp:launchpad
Ian Booth has proposed merging lp:~wallyworld/launchpad/fix-hardcoded-test-urls into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
This branch is part of the effort to support parallel test runs. It removes the use of hard coded urls (in particular port numbers) in doc, windmill, yui and unit tests. Currently, when running tests, the (only) test app server instance is run up on port 8085, which results in urls like "http://launchpad.dev:8085/xxxx"; such urls are then used a string literals in tests eg browser.open("http://launchpad.dev:8085/xxxx"). This practice is not compatible with the need to allow the root url to be defined on the fly so that multiple test instances can be run in parallel.
Implementation
--------------------
The CanonicalConfig class has a new method:
def root_launchpad_url(self, facet='mainsite', ensureSlash=False):
"""Return the correct root url for the given facet."""
So for a given config in use when running tests, it is possible to find out what the correct root url to use is. eg
facet='mainsite' -> http://launchpad.dev:<port>
facet ='code' -> http://code.launchpad.dev:<port> etc
At the moment, there's only one possible named config - 'testrunner-appserver' but with other changes being done to support parallel tests, this name will be parameterised. A class method has been added to BaseLayer to allow the correct config instance to be retrieved:
@classmethod
def getAppServerConfig(cls):
"""Return a config suitable for AppServer tests."""
# XXX wallyworld 2010-10-18
# use BaseLayer.appserver_config_name when available
return CanonicalConfig('testrunner-appserver')
To make it easy for test code to simply get the correct root url instead of using a hard coded string literal, helper methods have been added to canonical/testing/__init__.py
def getAppServerConfig():
"""Return a config suitable for AppServer tests."""
return BaseLayer.getAppServerConfig()
def getRootLaunchpadUrl(facet='mainsite', ensureSlash=False):
"""Return the correct root url for the given facet."""
return getAppServerConfig().root_launchpad_url(facet, ensureSlash)
So test code can do stuff like the following, which is pretty straight forward:
New:
from canonical.testing import getRootLaunchpadUrl
root_url = getRootLaunchpadUrl()
Old:
root_url = 'http://launchpad.dev:8085'
For doc tests, it was necessary to add some extra properties to canonical/launchpad/testing/browser.Browser:
- vhost
- rooturl
- urlpath
These enabled expected output tests to be refactored to remove the reference to the hard coded port number.
For windmill tests, the BaseWindmillLayer class has a base_url property. This property is now set during the test set up using the root url derived from the config instance. Existing windmill code was perhaps poorly written in that despite this base_url property being available, hard coded urls were still used. So there were simple replaced with references to the base_url property.
Next Steps
--------------
Once this branch lands, and once the branch lp:~lifeless/launchpad/uniqueconfig lands, then the next step is to remove the hard coded app server config name 'testrunner-appserver' and use the parameterised one from BaseLayer instead.
Tests
------
bin/test -vvt launchpadlib.txt
bin/test -vvt cookie-authentication.txt
bin/test -vvt login.txt
bin/test -vvt no-anonymous-session-cookies.txt
bin/test -vvt webapp.tests.test_login
bin/test -vvt shipit-login.txt
bin/test -vvt windmill
bin/test -vvt test_sourcepackagerecipe
bin/test -vvt test_productseries_setbranch
bin/test -vvt test_yui
Lint
----
Some drive by lint fixes were done. The remaining issues were already in the code base.
bin/lint.sh
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/canonical/config/__init__.py
lib/canonical/launchpad/doc/launchpadlib.txt
lib/canonical/launchpad/testing/browser.py
lib/canonical/launchpad/webapp/tests/cookie-authentication.txt
lib/canonical/launchpad/webapp/tests/login.txt
lib/canonical/launchpad/webapp/tests/no-anonymous-session-cookies.txt
lib/canonical/launchpad/webapp/tests/test_login.py
lib/canonical/testing/__init__.py
lib/canonical/testing/layers.py
lib/lp/bugs/windmill/testing.py
lib/lp/bugs/windmill/tests/test_bug_also_affects_new_upstream.py
lib/lp/bugs/windmill/tests/test_bug_commenting.py
lib/lp/bugs/windmill/tests/test_bug_inline_subscriber.py
lib/lp/bugs/windmill/tests/test_bug_me_too.py
lib/lp/bugs/windmill/tests/test_bug_privacy_settings.py
lib/lp/bugs/windmill/tests/test_filebug_dupe_finder.py
lib/lp/bugs/windmill/tests/test_filebug_extra_options.py
lib/lp/bugs/windmill/tests/test_mark_duplicate.py
lib/lp/bugs/windmill/tests/test_official_bug_tags_management.py
lib/lp/code/model/tests/test_sourcepackagerecipe.py
lib/lp/code/windmill/testing.py
lib/lp/code/windmill/tests/test_branch_bugspeclinks.py
lib/lp/code/windmill/tests/test_branch_subscriptions.py
lib/lp/code/windmill/tests/test_branchmergeproposal_review.py
lib/lp/code/windmill/tests/test_productseries_setbranch.py
lib/lp/registry/windmill/testing.py
lib/lp/registry/windmill/tests/test_add_bugtracker.py
lib/lp/registry/windmill/tests/test_add_milestone.py
lib/lp/registry/windmill/tests/test_datetime_picker.py
lib/lp/registry/windmill/tests/test_person_picker.py
lib/lp/registry/windmill/tests/test_plusnew_step1.py
lib/lp/registry/windmill/tests/test_plusnew_step2.py
lib/lp/registry/windmill/tests/test_product.py
lib/lp/registry/windmill/tests/test_product_edit_people.py
lib/lp/registry/windmill/tests/test_project_licenses.py
lib/lp/registry/windmill/tests/test_team_index.py
lib/lp/registry/windmill/tests/test_timeline_graph.py
lib/lp/services/mailman/doc/contact-address.txt
lib/lp/services/mailman/doc/create-lists.txt
lib/lp/services/mailman/doc/deactivate-lists.txt
lib/lp/services/mailman/doc/decorations.txt
lib/lp/services/mailman/doc/modify-lists.txt
lib/lp/services/mailman/doc/postings.txt
lib/lp/services/mailman/doc/reactivate-lists.txt
lib/lp/services/mailman/doc/recovery.txt
lib/lp/services/mailman/testing/helpers.py
lib/lp/soyuz/windmill/testing.py
lib/lp/soyuz/windmill/tests/test_archive_packages.py
lib/lp/soyuz/windmill/tests/test_archivesubscribersindex.py
lib/lp/soyuz/windmill/tests/test_ppainlineedit.py
lib/lp/testing/__init__.py
lib/lp/testing/factory.py
lib/lp/translations/windmill/testing.py
lib/lp/translations/windmill/tests/disabled_test_productseries_templates.py
lib/lp/translations/windmill/tests/test_documentation_links.py
lib/lp/translations/windmill/tests/test_import_queue.py
lib/lp/translations/windmill/tests/test_languages.py
lib/lp/translations/windmill/tests/test_pofile_translate.py
lib/lp/translations/windmill/tests/test_serieslanguages.py
./lib/canonical/config/__init__.py
330: W602 deprecated form of raising exception
332: W602 deprecated form of raising exception
334: W602 deprecated form of raising exception
376: E202 whitespace before ')'
./lib/canonical/launchpad/doc/launchpadlib.txt
1: narrative uses a moin header.
./lib/canonical/launchpad/webapp/tests/cookie-authentication.txt
22: want exceeds 78 characters.
./lib/canonical/launchpad/webapp/tests/login.txt
20: want exceeds 78 characters.
./lib/canonical/launchpad/webapp/tests/no-anonymous-session-cookies.txt
24: want exceeds 78 characters.
./lib/canonical/testing/__init__.py
83: 'from canonical.testing.layers import *' used; unable to detect undefined names
79: 'canonical' imported but unused
./lib/canonical/testing/layers.py
84: redefinition of unused 'zope' from line 83
532: redefinition of unused 'pidfile' from line 96
332: E231 missing whitespace after ','
400: E202 whitespace before ')'
475: E302 expected 2 blank lines, found 1
592: E202 whitespace before ')'
608: E202 whitespace before ')'
628: E202 whitespace before ')'
742: E202 whitespace before ')'
869: E301 expected 1 blank line, found 0
878: W291 trailing whitespace
1010: E301 expected 1 blank line, found 2
1037: E202 whitespace before ')'
1047: E202 whitespace before ')'
1093: E202 whitespace before ')'
1114: E202 whitespace before ')'
1152: E301 expected 1 blank line, found 2
1249: E301 expected 1 blank line, found 0
1312: E302 expected 2 blank lines, found 3
1410: E202 whitespace before ')'
1423: E202 whitespace before ')'
1427: E301 expected 1 blank line, found 2
1511: E301 expected 1 blank line, found 0
1531: E301 expected 1 blank line, found 0
1561: E301 expected 1 blank line, found 2
1619: E301 expected 1 blank line, found 0
878: Line has trailing whitespace.
883: Line exceeds 78 characters.
./lib/lp/bugs/windmill/testing.py
12: 'config' imported but unused
./lib/lp/bugs/windmill/tests/test_bug_also_affects_new_upstream.py
21: E302 expected 2 blank lines, found 1
37: E501 line too long (81 characters)
38: E501 line too long (82 characters)
39: E501 line too long (81 characters)
58: E302 expected 2 blank lines, found 1
37: Line exceeds 78 characters.
38: Line exceeds 78 characters.
39: Line exceeds 78 characters.
./lib/lp/bugs/windmill/tests/test_bug_inline_subscriber.py
20: E302 expected 2 blank lines, found 1
249: E302 expected 2 blank lines, found 1
./lib/lp/bugs/windmill/tests/test_bug_me_too.py
24: E302 expected 2 blank lines, found 1
33: E301 expected 1 blank line, found 0
126: E302 expected 2 blank lines, found 1
./lib/lp/bugs/windmill/tests/test_bug_privacy_settings.py
179: E302 expected 2 blank lines, found 1
./lib/lp/bugs/windmill/tests/test_filebug_dupe_finder.py
33: E302 expected 2 blank lines, found 1
122: E302 expected 2 blank lines, found 1
./lib/lp/bugs/windmill/tests/test_mark_duplicate.py
145: E302 expected 2 blank lines, found 1
./lib/lp/bugs/windmill/tests/test_official_bug_tags_management.py
214: E302 expected 2 blank lines, found 1
./lib/lp/code/windmill/tests/test_productseries_setbranch.py
56: E302 expected 2 blank lines, found 1
./lib/lp/registry/windmill/tests/test_add_milestone.py
9: 'time' imported but unused
./lib/lp/registry/windmill/tests/test_timeline_graph.py
81: E302 expected 2 blank lines, found 1
./lib/lp/services/mailman/testing/helpers.py
167: E202 whitespace before ']'
299: E301 expected 1 blank line, found 0
306: E301 expected 1 blank line, found 0
./lib/lp/soyuz/windmill/tests/test_archivesubscribersindex.py
102: E302 expected 2 blank lines, found 1
./lib/lp/testing/__init__.py
132: 'anonymous_logged_in' imported but unused
132: 'with_anonymous_login' imported but unused
132: 'is_logged_in' imported but unused
151: 'launchpadlib_for' imported but unused
151: 'launchpadlib_credentials_for' imported but unused
132: 'person_logged_in' imported but unused
151: 'oauth_access_token_for' imported but unused
132: 'login_celebrity' imported but unused
132: 'with_celebrity_logged_in' imported but unused
150: 'test_tales' imported but unused
132: 'celebrity_logged_in' imported but unused
132: 'run_with_login' imported but unused
132: 'with_person_logged_in' imported but unused
132: 'login_team' imported but unused
132: 'login_person' imported but unused
132: 'login_as' imported but unused
447: E301 expected 1 blank line, found 0
878: E301 expected 1 blank line, found 0
904: E302 expected 2 blank lines, found 1
980: E302 expected 2 blank lines, found 1
./lib/lp/testing/factory.py
3157: redefinition of function 'makePackageDiff' from line 1847
./lib/lp/translations/windmill/tests/test_pofile_translate.py
78: E202 whitespace before ')'
494: W391 blank line at end of file
./lib/lp/translations/windmill/tests/test_serieslanguages.py
81: W391 blank line at end of file
--
https://code.launchpad.net/~wallyworld/launchpad/fix-hardcoded-test-urls/+merge/38779
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wallyworld/launchpad/fix-hardcoded-test-urls into lp:launchpad.
=== modified file 'lib/canonical/config/__init__.py'
--- lib/canonical/config/__init__.py 2010-05-26 10:42:10 +0000
+++ lib/canonical/config/__init__.py 2010-10-18 22:52:44 +0000
@@ -56,8 +56,7 @@
# The directories containing instances configuration directories.
CONFIG_ROOT_DIRS = [
os.path.join(TREE_ROOT, 'configs'),
- os.path.join(TREE_ROOT, 'production-configs')
- ]
+ os.path.join(TREE_ROOT, 'production-configs')]
def find_instance_name():
@@ -98,6 +97,7 @@
is thread safe (not that this will be a problem if we stick with
simple configuration).
"""
+
def __init__(self, instance_name=None, process_name=None):
"""Create a new instance of CanonicalConfig.
@@ -239,6 +239,15 @@
</configure>""" % self.config_dir
loader.close()
+ def root_launchpad_url(self, facet='mainsite', ensureSlash=False):
+ """Return the correct root url for the given facet."""
+ root_url = str(getattr(self.vhost, facet).rooturl)
+ if not ensureSlash:
+ return root_url.rstrip('/')
+ if not root_url.endswith('/'):
+ return root_url+'/'
+ return root_url
+
def __getattr__(self, name):
self._getConfig()
# Check first if it's not one of the name added directly
@@ -277,6 +286,7 @@
value = urlunparse(bits)
return value
+
def urlbase(value):
"""ZConfig validator for url bases
=== modified file 'lib/canonical/launchpad/doc/launchpadlib.txt'
--- lib/canonical/launchpad/doc/launchpadlib.txt 2009-10-22 13:02:12 +0000
+++ lib/canonical/launchpad/doc/launchpadlib.txt 2010-10-18 22:52:44 +0000
@@ -4,20 +4,26 @@
if a specific user exists...
>>> browser = Browser('foo.bar@xxxxxxxxxxxxx:test')
- >>> browser.open('http://launchpad.dev:8085/')
- >>> browser.url
- 'http://launchpad.dev:8085/'
+ >>> from canonical.testing import getRootLaunchpadUrl
+ >>> root_url = getRootLaunchpadUrl()
+ >>> browser.open(root_url)
+ >>> browser.vhost
+ 'http://launchpad.dev'
+ >>> browser.urlpath
+ '/'
- >>> browser.open('http://launchpad.dev:8085/~stimpy')
+ >>> browser.open('%s/~stimpy' % root_url)
Traceback (most recent call last):
...
HTTPError: HTTP Error 404: Not Found
...and when he doesn't, create him.
- >>> browser.open('http://launchpad.dev:8085/people/+newteam')
+ >>> browser.open('%s/people/+newteam' % root_url)
>>> browser.getControl(name='field.name').value = 'stimpy'
>>> browser.getControl('Display Name').value = 'Stimpson J. Cat'
>>> browser.getControl('Create').click()
- >>> browser.url
- 'http://launchpad.dev:8085/~stimpy'
+ >>> browser.vhost
+ 'http://launchpad.dev'
+ >>> browser.urlpath
+ '/~stimpy'
=== modified file 'lib/canonical/launchpad/testing/browser.py'
--- lib/canonical/launchpad/testing/browser.py 2010-08-20 20:31:18 +0000
+++ lib/canonical/launchpad/testing/browser.py 2010-10-18 22:52:44 +0000
@@ -14,6 +14,7 @@
latter prevents open socket leaks even when the doctest doesn't explicitly
close or delete the browser instance.
"""
+from lazr.uri._uri import URI
__metaclass__ = type
__all__ = [
@@ -121,6 +122,21 @@
raise
self._stop_timer()
+ @property
+ def vhost(self):
+ uri = URI(self.url)
+ return '%s://%s' % (uri.scheme, uri.host)
+
+ @property
+ def rooturl(self):
+ uri = URI(self.url)
+ return '%s://%s:%s' % (uri.scheme, uri.host, uri.port)
+
+ @property
+ def urlpath(self):
+ uri = URI(self.url)
+ return uri.path
+
def setUp(test):
"""Set up appserver tests."""
=== modified file 'lib/canonical/launchpad/webapp/tests/cookie-authentication.txt'
--- lib/canonical/launchpad/webapp/tests/cookie-authentication.txt 2010-08-16 11:36:08 +0000
+++ lib/canonical/launchpad/webapp/tests/cookie-authentication.txt 2010-10-18 22:52:44 +0000
@@ -2,16 +2,21 @@
on http instead of https, it cannot read the secure cookie on https,
so it cannot tell that it will end up overwriting the existing cookie.
- >>> browser.open('http://feeds.launchpad.dev:8085/announcements.atom')
- >>> browser.url
- 'http://feeds.launchpad.dev:8085/announcements.atom'
+ >>> from canonical.testing import getRootLaunchpadUrl
+ >>> feeds_root_url = getRootLaunchpadUrl('feeds')
+ >>> browser.open('%s/announcements.atom' % feeds_root_url)
+ >>> browser.vhost
+ 'http://feeds.launchpad.dev'
+ >>> browser.urlpath
+ '/announcements.atom'
>>> len(browser.cookies)
0
Our cookies need to have their domain attribute set to ensure that they
are sent to other vhosts in the same domain.
- >>> browser.open('http://blueprints.launchpad.dev:8085/+login')
+ >>> blueprints_root_url = getRootLaunchpadUrl('blueprints')
+ >>> browser.open('%s/+login' % blueprints_root_url)
# On a browser with JS support, this page would've been automatically
# submitted (thanks to the onload handler), but testbrowser doesn't support
@@ -28,7 +33,7 @@
# Open a page again so that we see the cookie for a launchpad.dev request
# and not a testopenid.dev request (as above).
- >>> browser.open('http://blueprints.launchpad.dev:8085')
+ >>> browser.open(blueprints_root_url)
>>> len(browser.cookies)
1
>>> browser.cookies.keys()
@@ -39,9 +44,12 @@
If we visit another vhost in the domain, we remain logged in.
- >>> browser.open('http://launchpad.dev:8085/')
- >>> browser.url
- 'http://launchpad.dev:8085/'
+ >>> root_url = getRootLaunchpadUrl()
+ >>> browser.open(root_url)
+ >>> browser.vhost
+ 'http://launchpad.dev'
+ >>> browser.urlpath
+ '/'
>>> print extract_text(find_tag_by_id(browser.contents, 'logincontrol'))
name16...
>>> browser.cookies.getinfo(session_cookie_name)['domain']
@@ -49,9 +57,11 @@
Even if the browser passes in a cookie, the feeds vhost should not set one.
- >>> browser.open('http://feeds.launchpad.dev:8085/announcements.atom')
- >>> browser.url
- 'http://feeds.launchpad.dev:8085/announcements.atom'
+ >>> browser.open('%s/announcements.atom' % feeds_root_url)
+ >>> browser.vhost
+ 'http://feeds.launchpad.dev'
+ >>> browser.urlpath
+ '/announcements.atom'
>>> print browser.headers.get('Set-Cookie')
None
=== modified file 'lib/canonical/launchpad/webapp/tests/login.txt'
--- lib/canonical/launchpad/webapp/tests/login.txt 2010-02-25 10:50:31 +0000
+++ lib/canonical/launchpad/webapp/tests/login.txt 2010-10-18 22:52:44 +0000
@@ -8,10 +8,12 @@
# Set handleErrors to True so that the Unauthorized exception is handled
# by the publisher and we get redirected to the +login page.
+ >>> from canonical.testing import getRootLaunchpadUrl
+ >>> root_url = getRootLaunchpadUrl()
>>> browser = Browser()
>>> browser.handleErrors = True
>>> browser.open(
- ... 'http://launchpad.dev:8085/people/?name=foo&searchfor=all')
+ ... '%s/people/?name=foo&searchfor=all' % root_url)
>>> browser.getLink('Log in / Register').click()
# On a browser with JS support, this page would've been automatically
@@ -32,16 +34,17 @@
Once authenticated, we're redirected back to the page where we started, with
the query args preserved.
- >>> url = browser.url
- >>> print url
- http://launchpad.dev:8085/people?...
+ >>> browser.vhost
+ 'http://launchpad.dev'
+ >>> browser.urlpath
+ '/people'
>>> import re
- >>> print sorted(re.sub('.*\?', '', url).split('&'))
+ >>> print sorted(re.sub('.*\?', '', browser.url).split('&'))
['name=foo', 'searchfor=all']
If we load the +login page while already logged in, it will say we're already
logged in and ask us to log out if we're somebody else.
- >>> browser.open('http://launchpad.dev:8085/+login')
+ >>> browser.open('%s/+login' % root_url)
>>> print extract_text(find_main_content(browser.contents))
You are already logged in...
=== modified file 'lib/canonical/launchpad/webapp/tests/no-anonymous-session-cookies.txt'
--- lib/canonical/launchpad/webapp/tests/no-anonymous-session-cookies.txt 2010-08-13 10:06:42 +0000
+++ lib/canonical/launchpad/webapp/tests/no-anonymous-session-cookies.txt 2010-10-18 22:52:44 +0000
@@ -5,7 +5,9 @@
When we go to launchpad as an anonymous user, the browser has no cookies.
- >>> browser.open('http://launchpad.dev:8085')
+ >>> from canonical.testing import getRootLaunchpadUrl
+ >>> root_url = getRootLaunchpadUrl()
+ >>> browser.open(root_url)
>>> len(browser.cookies)
0
@@ -16,7 +18,7 @@
>>> now = datetime.datetime.now(pytz.UTC).replace(microsecond=0)
>>> year_from_now = now + datetime.timedelta(days=365)
>>> year_plus_from_now = year_from_now + datetime.timedelta(minutes=1)
- >>> browser.open('http://launchpad.dev:8085/+login')
+ >>> browser.open('%s/+login' % root_url)
# On a browser with JS support, this page would've been automatically
# submitted (thanks to the onload handler), but testbrowser doesn't support
@@ -33,7 +35,7 @@
# Open a page again so that we see the cookie for a launchpad.dev request
# and not a testopenid.dev request (as above).
- >>> browser.open('http://launchpad.dev:8085')
+ >>> browser.open(root_url)
>>> len(browser.cookies)
1
@@ -61,7 +63,7 @@
After ensuring the browser has not left the launchpad.dev domain, the
single cookie is shown to have the ten minute expiration.
- >>> browser.open('http://launchpad.dev:8085')
+ >>> browser.open(root_url)
>>> len(browser.cookies)
1
>>> expires = browser.cookies.getinfo('launchpad_tests')['expires']
=== modified file 'lib/canonical/launchpad/webapp/tests/test_login.py'
--- lib/canonical/launchpad/webapp/tests/test_login.py 2010-09-03 11:10:09 +0000
+++ lib/canonical/launchpad/webapp/tests/test_login.py 2010-10-18 22:52:44 +0000
@@ -57,6 +57,7 @@
OpenIDLogin,
)
from canonical.launchpad.webapp.servers import LaunchpadTestRequest
+from canonical.testing import getRootLaunchpadUrl
from canonical.testing.layers import (
AppServerLayer,
DatabaseFunctionalLayer,
@@ -549,7 +550,7 @@
def test_replay_attacks_do_not_succeed(self):
browser = Browser(mech_browser=MyMechanizeBrowser())
- browser.open('http://launchpad.dev:8085/+login')
+ browser.open('%s/+login' % getRootLaunchpadUrl())
# On a JS-enabled browser this page would've been auto-submitted
# (thanks to the onload handler), but here we have to do it manually.
self.assertIn('body onload', browser.contents)
@@ -650,20 +651,20 @@
def test_realm_for_mainsite(self):
browser = Browser()
- browser.open('http://launchpad.dev:8085/+login')
+ browser.open('%s/+login' % getRootLaunchpadUrl())
# At this point browser.contents contains a hidden form which would've
# been auto-submitted if we had in-browser JS support, but since we
# don't we can easily inspect what's in the form.
- self.assertEquals('http://launchpad.dev:8085/',
+ self.assertEquals('%s/' % browser.rooturl,
browser.getControl(name='openid.realm').value)
def test_realm_for_vhosts(self):
browser = Browser()
- browser.open('http://bugs.launchpad.dev:8085/+login')
+ browser.open('%s/+login' % getRootLaunchpadUrl('bugs'))
# At this point browser.contents contains a hidden form which would've
# been auto-submitted if we had in-browser JS support, but since we
# don't we can easily inspect what's in the form.
- self.assertEquals('http://launchpad.dev:8085/',
+ self.assertEquals('%s/' % browser.rooturl,
browser.getControl(name='openid.realm').value)
=== modified file 'lib/canonical/testing/__init__.py'
--- lib/canonical/testing/__init__.py 2010-05-06 15:36:19 +0000
+++ lib/canonical/testing/__init__.py 2010-10-18 22:52:44 +0000
@@ -11,6 +11,8 @@
'DatabaseLayer',
'ExperimentalLaunchpadZopelessLayer',
'FunctionalLayer',
+ 'getAppServerConfig'
+ 'getRootLaunchpadUrl',
'LaunchpadFunctionalLayer',
'LaunchpadLayer',
'LaunchpadScriptLayer',
@@ -64,6 +66,15 @@
Logging(Runner()).global_setup()
+def getAppServerConfig():
+ """Return a config suitable for AppServer tests."""
+ return BaseLayer.getAppServerConfig()
+
+
+def getRootLaunchpadUrl(facet='mainsite', ensureSlash=False):
+ """Return the correct root url for the given facet."""
+ return getAppServerConfig().root_launchpad_url(facet, ensureSlash)
+
# This import registers the 'doctest' Unicode codec.
import canonical.testing.doctestcodec
=== modified file 'lib/canonical/testing/layers.py'
--- lib/canonical/testing/layers.py 2010-10-17 05:02:20 +0000
+++ lib/canonical/testing/layers.py 2010-10-18 22:52:44 +0000
@@ -469,6 +469,12 @@
finally:
del frame # As per no-leak stack inspection in Python reference.
+ @classmethod
+ def getAppServerConfig(cls):
+ """Return a config suitable for AppServer tests."""
+ # XXX wallyworld 2010-10-18
+ # use BaseLayer.appserver_config_name when available
+ return CanonicalConfig('testrunner-appserver')
class MemcachedLayer(BaseLayer):
"""Provides tests access to a memcached.
@@ -1932,15 +1938,11 @@
# Patch the config to provide the port number and not use https.
sites = (
- ('vhost.mainsite', 'rooturl: http://launchpad.dev:8085/'),
- ('vhost.answers', 'rooturl: http://answers.launchpad.dev:8085/'),
- ('vhost.blueprints',
- 'rooturl: http://blueprints.launchpad.dev:8085/'),
- ('vhost.bugs', 'rooturl: http://bugs.launchpad.dev:8085/'),
- ('vhost.code', 'rooturl: http://code.launchpad.dev:8085/'),
- ('vhost.testopenid', 'rooturl: http://testopenid.dev:8085/'),
- ('vhost.translations',
- 'rooturl: http://translations.launchpad.dev:8085/'))
+ (('vhost.%s' % sitename,
+ 'rooturl: %s/' % getattr(BaseLayer.getAppServerConfig().vhost,
+ sitename).rooturl)
+ for sitename in ['mainsite', 'answers', 'blueprints', 'bugs',
+ 'code', 'testopenid', 'translations']))
for site in sites:
config.push('windmillsettings', "\n[%s]\n%s\n" % site)
allvhosts.reload()
@@ -2011,7 +2013,7 @@
# driver from out here.
config_text = dedent("""\
START_FIREFOX = True
- TEST_URL = '%s'
+ TEST_URL = '%s/'
CONSOLE_LOG_LEVEL = %d
""" % (cls.base_url, logging.NOTSET))
cls.config_file = tempfile.NamedTemporaryFile(suffix='.py')
=== modified file 'lib/lp/bugs/windmill/testing.py'
--- lib/lp/bugs/windmill/testing.py 2009-09-15 08:58:30 +0000
+++ lib/lp/bugs/windmill/testing.py 2010-10-18 22:52:44 +0000
@@ -9,10 +9,12 @@
]
+from canonical.config import config
from canonical.testing.layers import BaseWindmillLayer
class BugsWindmillLayer(BaseWindmillLayer):
"""Layer for Bugs Windmill tests."""
- base_url = 'http://bugs.launchpad.dev:8085/'
+ from canonical.testing import getRootLaunchpadUrl
+ base_url = getRootLaunchpadUrl('bugs')
=== modified file 'lib/lp/bugs/windmill/tests/test_bug_also_affects_new_upstream.py'
--- lib/lp/bugs/windmill/tests/test_bug_also_affects_new_upstream.py 2010-08-20 20:31:18 +0000
+++ lib/lp/bugs/windmill/tests/test_bug_also_affects_new_upstream.py 2010-10-18 22:52:44 +0000
@@ -15,8 +15,8 @@
from lp.testing import WindmillTestCase
-CHOOSE_AFFECTED_URL = ('http://bugs.launchpad.dev:8085/tomcat/+bug/3/'
- '+choose-affected-product')
+CHOOSE_AFFECTED_URL = ('%s/tomcat/+bug/3/+choose-affected-product'
+ % BugsWindmillLayer.base_url)
class TestBugAlsoAffects(WindmillTestCase):
=== modified file 'lib/lp/bugs/windmill/tests/test_bug_commenting.py'
--- lib/lp/bugs/windmill/tests/test_bug_commenting.py 2010-08-20 20:31:18 +0000
+++ lib/lp/bugs/windmill/tests/test_bug_commenting.py 2010-10-18 22:52:44 +0000
@@ -31,7 +31,7 @@
client = self.client
lpuser.NO_PRIV.ensure_login(client)
- client.open(url='http://bugs.launchpad.dev:8085/bugs/1')
+ client.open(url='%s/bugs/1' % BugsWindmillLayer.base_url)
client.waits.forPageLoad(timeout=WAIT_PAGELOAD)
client.waits.forElement(xpath=ADD_COMMENT_BUTTON)
=== modified file 'lib/lp/bugs/windmill/tests/test_bug_inline_subscriber.py'
--- lib/lp/bugs/windmill/tests/test_bug_inline_subscriber.py 2010-08-20 20:31:18 +0000
+++ lib/lp/bugs/windmill/tests/test_bug_inline_subscriber.py 2010-10-18 22:52:44 +0000
@@ -13,7 +13,7 @@
from lp.testing import WindmillTestCase
-BUG_URL = u'http://bugs.launchpad.dev:8085/bugs/%s'
+BUG_URL = u'%s/bugs/%%s' % BugsWindmillLayer.base_url
SUBSCRIPTION_LINK = u'//div[@id="portlet-subscribers"]/div/div/a'
PERSON_LINK = u'//div[@id="subscribers-links"]/div/a[@name="%s"]'
=== modified file 'lib/lp/bugs/windmill/tests/test_bug_me_too.py'
--- lib/lp/bugs/windmill/tests/test_bug_me_too.py 2010-08-20 20:31:18 +0000
+++ lib/lp/bugs/windmill/tests/test_bug_me_too.py 2010-10-18 22:52:44 +0000
@@ -57,7 +57,7 @@
# Open bug 11 and wait for it to finish loading.
client.open(
- url=u'http://bugs.launchpad.dev:8085/jokosher/+bug/11/+index')
+ url=u'%s/jokosher/+bug/11/+index' % BugsWindmillLayer.base_url)
client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
lpuser.SAMPLE_PERSON.ensure_login(client)
=== modified file 'lib/lp/bugs/windmill/tests/test_bug_privacy_settings.py'
--- lib/lp/bugs/windmill/tests/test_bug_privacy_settings.py 2010-08-20 20:31:18 +0000
+++ lib/lp/bugs/windmill/tests/test_bug_privacy_settings.py 2010-10-18 22:52:44 +0000
@@ -11,7 +11,7 @@
from lp.testing import WindmillTestCase
-BUG_URL = u'http://bugs.launchpad.dev:8085/bugs/15'
+BUG_URL = u'%s/bugs/15' % BugsWindmillLayer.base_url
MAIN_FORM_ELEMENT = u'//div[@id="privacy-form-container"]/div'
FORM_NOT_VISIBLE = (
u'element.className.search("yui-lazr-formoverlay-hidden") != -1')
=== modified file 'lib/lp/bugs/windmill/tests/test_filebug_dupe_finder.py'
--- lib/lp/bugs/windmill/tests/test_filebug_dupe_finder.py 2010-08-20 20:31:18 +0000
+++ lib/lp/bugs/windmill/tests/test_filebug_dupe_finder.py 2010-10-18 22:52:44 +0000
@@ -11,7 +11,7 @@
from lp.testing import WindmillTestCase
-FILEBUG_URL = 'http://bugs.launchpad.dev:8085/firefox/+filebug'
+FILEBUG_URL = '%s/firefox/+filebug' % BugsWindmillLayer.base_url
FORM_OVERLAY = u'//div[@id="duplicate-overlay-bug-4"]/div'
FORM_OVERLAY_CANCEL = (
=== modified file 'lib/lp/bugs/windmill/tests/test_filebug_extra_options.py'
--- lib/lp/bugs/windmill/tests/test_filebug_extra_options.py 2010-08-20 20:31:18 +0000
+++ lib/lp/bugs/windmill/tests/test_filebug_extra_options.py 2010-10-18 22:52:44 +0000
@@ -25,7 +25,7 @@
client = self.client
# Open a +filebug page and wait for it to finish loading.
- client.open(url=u'http://bugs.launchpad.dev:8085/firefox/+filebug')
+ client.open(url=u'%s/firefox/+filebug' % BugsWindmillLayer.base_url)
client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
lpuser.SAMPLE_PERSON.ensure_login(client)
=== modified file 'lib/lp/bugs/windmill/tests/test_mark_duplicate.py'
--- lib/lp/bugs/windmill/tests/test_mark_duplicate.py 2010-08-20 20:31:18 +0000
+++ lib/lp/bugs/windmill/tests/test_mark_duplicate.py 2010-10-18 22:52:44 +0000
@@ -41,7 +41,7 @@
client = self.client
# Open a bug page and wait for it to finish loading
- client.open(url=u'http://bugs.launchpad.dev:8085/bugs/15')
+ client.open(url=u'%s/bugs/15' % BugsWindmillLayer.base_url)
client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
lpuser.SAMPLE_PERSON.ensure_login(client)
@@ -121,7 +121,7 @@
timeout=constants.FOR_ELEMENT)
# When we go back to the page for the duplicate bug...
- client.open(url=u'http://bugs.launchpad.dev:8085/bugs/15')
+ client.open(url=u'%s/bugs/15' % BugsWindmillLayer.base_url)
client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
client.waits.forElement(
xpath=MAIN_FORM_ELEMENT, timeout=constants.FOR_ELEMENT)
=== modified file 'lib/lp/bugs/windmill/tests/test_official_bug_tags_management.py'
--- lib/lp/bugs/windmill/tests/test_official_bug_tags_management.py 2010-08-20 20:31:18 +0000
+++ lib/lp/bugs/windmill/tests/test_official_bug_tags_management.py 2010-10-18 22:52:44 +0000
@@ -27,7 +27,7 @@
# Firefox is a product - an official bug tags target.
- client.open(url='http://bugs.launchpad.dev:8085/firefox')
+ client.open(url='%s/firefox' % BugsWindmillLayer.base_url)
client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
lpuser.FOO_BAR.ensure_login(client)
=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipe.py'
--- lib/lp/code/model/tests/test_sourcepackagerecipe.py 2010-09-22 21:03:48 +0000
+++ lib/lp/code/model/tests/test_sourcepackagerecipe.py 2010-10-18 22:52:44 +0000
@@ -731,8 +731,9 @@
recipe_text = self.makeRecipeText()
db_archive = self.factory.makeArchive(owner=owner, name="recipe-ppa")
transaction.commit()
+ from canonical.testing import getRootLaunchpadUrl
launchpad = launchpadlib_for('test', user,
- service_root="http://api.launchpad.dev:8085")
+ service_root=getRootLaunchpadUrl('api'))
login(ANONYMOUS)
distroseries = ws_object(launchpad, db_distroseries)
ws_owner = ws_object(launchpad, owner)
=== modified file 'lib/lp/code/windmill/testing.py'
--- lib/lp/code/windmill/testing.py 2010-01-13 23:13:21 +0000
+++ lib/lp/code/windmill/testing.py 2010-10-18 22:52:44 +0000
@@ -15,4 +15,5 @@
class CodeWindmillLayer(BaseWindmillLayer):
"""Layer for Code Windmill tests."""
- base_url = 'http://code.launchpad.dev:8085/'
+ from canonical.testing import getRootLaunchpadUrl
+ base_url = getRootLaunchpadUrl('code')
=== modified file 'lib/lp/code/windmill/tests/test_branch_bugspeclinks.py'
--- lib/lp/code/windmill/tests/test_branch_bugspeclinks.py 2010-02-01 18:37:00 +0000
+++ lib/lp/code/windmill/tests/test_branch_bugspeclinks.py 2010-10-18 22:52:44 +0000
@@ -43,7 +43,7 @@
lpuser.FOO_BAR.ensure_login(client)
start_url = (
- windmill.settings['TEST_URL'] + '/~mark/firefox/release--0.9.1')
+ windmill.settings['TEST_URL'] + '~mark/firefox/release--0.9.1')
client.open(url=start_url)
client.waits.forElement(id=u'linkbug', timeout=u'10000')
=== modified file 'lib/lp/code/windmill/tests/test_branch_subscriptions.py'
--- lib/lp/code/windmill/tests/test_branch_subscriptions.py 2010-08-20 20:31:18 +0000
+++ lib/lp/code/windmill/tests/test_branch_subscriptions.py 2010-10-18 22:52:44 +0000
@@ -29,7 +29,7 @@
lpuser.FOO_BAR.ensure_login(client)
client.open(url=(
- windmill.settings['TEST_URL'] + '/~mark/firefox/release--0.9.1'))
+ windmill.settings['TEST_URL'] + '~mark/firefox/release--0.9.1'))
client.waits.forElement(id=u'none-subscribers', timeout=u'10000')
client.asserts.assertText(
xpath=u'//a[@class="sprite add subscribe-self js-action"]',
@@ -66,7 +66,7 @@
client.open(url=''.join([
windmill.settings['TEST_URL'],
- '/~name12/landscape/feature-x/']))
+ '~name12/landscape/feature-x/']))
client.waits.forPageLoad(timeout=u'10000')
client.waits.forElement(
=== modified file 'lib/lp/code/windmill/tests/test_branchmergeproposal_review.py'
--- lib/lp/code/windmill/tests/test_branchmergeproposal_review.py 2010-08-20 20:31:18 +0000
+++ lib/lp/code/windmill/tests/test_branchmergeproposal_review.py 2010-10-18 22:52:44 +0000
@@ -45,7 +45,7 @@
client.open(url=''.join([
windmill.settings['TEST_URL'],
- '/~name12/gnome-terminal/klingon/']))
+ '~name12/gnome-terminal/klingon/']))
client.waits.forPageLoad(timeout=u'10000')
link = u'//a[@class="menu-link-register_merge sprite add"]'
=== modified file 'lib/lp/code/windmill/tests/test_productseries_setbranch.py'
--- lib/lp/code/windmill/tests/test_productseries_setbranch.py 2010-08-20 20:31:18 +0000
+++ lib/lp/code/windmill/tests/test_productseries_setbranch.py 2010-10-18 22:52:44 +0000
@@ -26,7 +26,7 @@
user = lpuser.FOO_BAR
user.ensure_login(self.client)
self.client.open(
- url=u'http://launchpad.dev:8085/firefox/trunk/+setbranch')
+ url=u'%s/firefox/trunk/+setbranch' % CodeWindmillLayer.base_url)
# To demonstrate the Javascript is loaded we simply need to see that
# one of the controls is deactivated when the radio button selections
=== modified file 'lib/lp/registry/windmill/testing.py'
--- lib/lp/registry/windmill/testing.py 2009-10-09 21:24:20 +0000
+++ lib/lp/registry/windmill/testing.py 2010-10-18 22:52:44 +0000
@@ -15,4 +15,5 @@
class RegistryWindmillLayer(BaseWindmillLayer):
"""Layer for Registry Windmill tests."""
- base_url = 'http://launchpad.dev:8085/'
+ from canonical.testing import getRootLaunchpadUrl
+ base_url = getRootLaunchpadUrl()
=== modified file 'lib/lp/registry/windmill/tests/test_add_bugtracker.py'
--- lib/lp/registry/windmill/tests/test_add_bugtracker.py 2010-08-20 20:31:18 +0000
+++ lib/lp/registry/windmill/tests/test_add_bugtracker.py 2010-10-18 22:52:44 +0000
@@ -91,7 +91,8 @@
def test_adding_bugtracker_for_project(self):
test_inline_add_bugtracker(
self.client,
- url='http://launchpad.dev:8085/bzr/+configure-bugtracker',
+ url='%s/bzr/+configure-bugtracker'
+ % RegistryWindmillLayer.base_url,
name='test_inline_add_bugtracker_for_project')
=== modified file 'lib/lp/registry/windmill/tests/test_add_milestone.py'
--- lib/lp/registry/windmill/tests/test_add_milestone.py 2010-08-20 20:31:18 +0000
+++ lib/lp/registry/windmill/tests/test_add_milestone.py 2010-10-18 22:52:44 +0000
@@ -87,7 +87,7 @@
def test_adding_milestone_on_addrelease_page(self):
test_inline_add_milestone(
self.client,
- url='http://launchpad.dev:8085/bzr/trunk/+addrelease',
+ url='%s/bzr/trunk/+addrelease' % RegistryWindmillLayer.base_url,
name='test_inline_add_milestone_for_release')
=== modified file 'lib/lp/registry/windmill/tests/test_datetime_picker.py'
--- lib/lp/registry/windmill/tests/test_datetime_picker.py 2010-08-20 20:31:18 +0000
+++ lib/lp/registry/windmill/tests/test_datetime_picker.py 2010-10-18 22:52:44 +0000
@@ -30,8 +30,9 @@
lpuser.SAMPLE_PERSON.ensure_login(self.client)
# Open a new sprint page and wait for it to finish loading.
+ from canonical.testing import getRootLaunchpadUrl
self.client.open(
- url=u'http://blueprints.launchpad.dev:8085/sprints/+new')
+ url=u'%s/sprints/+new' % getRootLaunchpadUrl('blueprints'))
self.client.waits.forPageLoad(timeout=u'20000')
self.client.waits.forElement(link=u'Choose...', timeout=u'8000')
=== modified file 'lib/lp/registry/windmill/tests/test_person_picker.py'
--- lib/lp/registry/windmill/tests/test_person_picker.py 2010-08-20 20:31:18 +0000
+++ lib/lp/registry/windmill/tests/test_person_picker.py 2010-10-18 22:52:44 +0000
@@ -30,7 +30,8 @@
client = self.client
lpuser.SAMPLE_PERSON.ensure_login(client)
- client.open(url=u'http://launchpad.dev:8085/people/+requestmerge')
+ client.open(url=u'%s/people/+requestmerge'
+ % RegistryWindmillLayer.base_url)
client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
client.waits.forElement(id=u'show-widget-field-dupe_person',
timeout=constants.FOR_ELEMENT)
=== modified file 'lib/lp/registry/windmill/tests/test_plusnew_step1.py'
--- lib/lp/registry/windmill/tests/test_plusnew_step1.py 2010-08-20 20:31:18 +0000
+++ lib/lp/registry/windmill/tests/test_plusnew_step1.py 2010-10-18 22:52:44 +0000
@@ -30,7 +30,8 @@
"""
# Perform step 1 of the project registration, using information
# that will yield search results.
- self.client.open(url=u'http://launchpad.dev:8085/projects/+new')
+ self.client.open(url=u'%s/projects/+new'
+ % RegistryWindmillLayer.base_url)
lpuser.SAMPLE_PERSON.ensure_login(self.client)
=== modified file 'lib/lp/registry/windmill/tests/test_plusnew_step2.py'
--- lib/lp/registry/windmill/tests/test_plusnew_step2.py 2010-08-20 20:31:18 +0000
+++ lib/lp/registry/windmill/tests/test_plusnew_step2.py 2010-10-18 22:52:44 +0000
@@ -32,7 +32,8 @@
# Perform step 1 of the project registration, using information
# that will yield search results.
- self.client.open(url=u'http://launchpad.dev:8085/projects/+new')
+ self.client.open(url=u'%s/projects/+new'
+ % RegistryWindmillLayer.base_url)
lpuser.SAMPLE_PERSON.ensure_login(self.client)
=== modified file 'lib/lp/registry/windmill/tests/test_product.py'
--- lib/lp/registry/windmill/tests/test_product.py 2010-08-20 20:31:18 +0000
+++ lib/lp/registry/windmill/tests/test_product.py 2010-10-18 22:52:44 +0000
@@ -23,7 +23,7 @@
def test_title_inline_edit(self):
test = widgets.InlineEditorWidgetTest(
- url='http://launchpad.dev:8085/firefox',
+ url='%s/firefox' % RegistryWindmillLayer.base_url,
widget_id='product-title',
expected_value='Mozilla Firefox',
new_value='The awesome Mozilla Firefox',
@@ -34,7 +34,7 @@
def test_programming_languages_edit(self):
test = widgets.InlineEditorWidgetTest(
- url='http://launchpad.dev:8085/firefox',
+ url='%s/firefox' % RegistryWindmillLayer.base_url,
widget_id='programminglang',
widget_tag='span',
expected_value='Not yet specified',
=== modified file 'lib/lp/registry/windmill/tests/test_product_edit_people.py'
--- lib/lp/registry/windmill/tests/test_product_edit_people.py 2010-08-20 20:31:18 +0000
+++ lib/lp/registry/windmill/tests/test_product_edit_people.py 2010-10-18 22:52:44 +0000
@@ -21,7 +21,7 @@
def test_product_edit_people_driver(self):
test = FormPickerWidgetTest(
name='test_product_edit_people_driver',
- url='http://launchpad.dev:8085/firefox/+edit-people',
+ url='%s/firefox/+edit-people' % RegistryWindmillLayer.base_url,
short_field_name='driver',
search_text='Perell\xc3\xb3',
result_index=1,
@@ -31,7 +31,7 @@
def test_product_edit_people_owner(self):
test = FormPickerWidgetTest(
name='test_product_edit_people_owner',
- url='http://launchpad.dev:8085/firefox/+edit-people',
+ url='%s/firefox/+edit-people' % RegistryWindmillLayer.base_url,
short_field_name='owner',
search_text='guadamen',
result_index=1,
=== modified file 'lib/lp/registry/windmill/tests/test_project_licenses.py'
--- lib/lp/registry/windmill/tests/test_project_licenses.py 2010-08-26 23:51:10 +0000
+++ lib/lp/registry/windmill/tests/test_project_licenses.py 2010-10-18 22:52:44 +0000
@@ -23,7 +23,8 @@
"""Test the dynamic aspects of the project license picker."""
# The firefox project is as good as any.
lpuser.SAMPLE_PERSON.ensure_login(self.client)
- self.client.open(url=u'http://launchpad.dev:8085/firefox/+edit')
+ self.client.open(url=u'%s/firefox/+edit'
+ % RegistryWindmillLayer.base_url)
self.client.waits.forPageLoad(timeout=u'20000')
# The Recommended table is visible.
@@ -126,7 +127,8 @@
self.client.click(id='field.actions.change')
self.client.waits.forPageLoad(timeout=u'20000')
- self.client.open(url=u'http://launchpad.dev:8085/firefox/+edit')
+ self.client.open(url=u'%s/firefox/+edit'
+ % RegistryWindmillLayer.base_url)
self.client.waits.forPageLoad(timeout=u'20000')
self.client.asserts.assertProperty(
=== modified file 'lib/lp/registry/windmill/tests/test_team_index.py'
--- lib/lp/registry/windmill/tests/test_team_index.py 2010-08-20 20:31:18 +0000
+++ lib/lp/registry/windmill/tests/test_team_index.py 2010-10-18 22:52:44 +0000
@@ -24,7 +24,7 @@
def test_addmember(self):
self.client.open(
- url=u'http://launchpad.dev:8085/~testing-spanish-team')
+ url=u'%s/~testing-spanish-team' % RegistryWindmillLayer.base_url)
lpuser.TRANSLATIONS_ADMIN.ensure_login(self.client)
=== modified file 'lib/lp/registry/windmill/tests/test_timeline_graph.py'
--- lib/lp/registry/windmill/tests/test_timeline_graph.py 2010-02-01 18:37:00 +0000
+++ lib/lp/registry/windmill/tests/test_timeline_graph.py 2010-10-18 22:52:44 +0000
@@ -22,7 +22,8 @@
"""Test timeline graph on /$project/+timeline-graph page."""
self.client.open(
- url=u'http://launchpad.dev:8085/firefox/+timeline-graph')
+ url=u'%s/firefox/+timeline-graph'
+ % RegistryWindmillLayer.base_url)
self.client.waits.forElement(id=u'spinner', timeout=u'20000')
self.client.waits.forElementProperty(
id=u'spinner',
@@ -35,7 +36,7 @@
def test_project_timeline_graph(self):
"""Test that the timeline graph loads on /$project page."""
- self.client.open(url=u'http://launchpad.dev:8085/firefox')
+ self.client.open(url=u'%s/firefox' % RegistryWindmillLayer.base_url)
self.client.waits.forElementProperty(
id=u'timeline-loading',
@@ -49,7 +50,8 @@
def test_series_timeline_graph(self):
"""Test that the timeline graph loads on /$project/$series page."""
- self.client.open(url=u'http://launchpad.dev:8085/firefox/trunk')
+ self.client.open(url=u'%s/firefox/trunk'
+ % RegistryWindmillLayer.base_url)
self.client.waits.forElementProperty(
id=u'timeline-iframe',
@@ -64,7 +66,8 @@
def test_all_series_timeline_graph(self):
"""Test that the timeline graph loads on /$project/+series page."""
- self.client.open(url=u'http://launchpad.dev:8085/firefox/+series')
+ self.client.open(url=u'%s/firefox/+series'
+ % RegistryWindmillLayer.base_url)
self.client.waits.forElement(
id=u'timeline-loading',
=== modified file 'lib/lp/services/mailman/doc/contact-address.txt'
--- lib/lp/services/mailman/doc/contact-address.txt 2009-12-02 22:56:09 +0000
+++ lib/lp/services/mailman/doc/contact-address.txt 2010-10-18 22:52:44 +0000
@@ -22,8 +22,10 @@
>>> from canonical.launchpad.testing.pages import strip_label
+ >>> from canonical.testing import getRootLaunchpadUrl
+ >>> root_url = getRootLaunchpadUrl()
>>> browser = Browser('no-priv@xxxxxxxxxxxxx:test')
- >>> browser.open('http://launchpad.dev:8085/~itest-one/+contactaddress')
+ >>> browser.open('%s/~itest-one/+contactaddress' % root_url)
>>> browser.getControl('The Launchpad mailing list').selected = True
>>> browser.getControl('Change').click()
@@ -33,8 +35,9 @@
>>> [strip_label(label) for label in control.displayValue]
['The Launchpad mailing list for this team...]
+ >>> answers_url = getRootLaunchpadUrl('answers')
>>> browser.open(
- ... 'http://answers.launchpad.dev:8085/firefox/+answer-contact')
+ ... '%s/firefox/+answer-contact' % answers_url)
>>> browser.getControl(name='field.answer_contact_teams').displayValue = [
... 'Itest One']
>>> browser.getControl('Continue').click()
@@ -42,7 +45,7 @@
Now that the contact address for the team is its mailing list, a new questions
will be delivered to the mailing list.
- >>> browser.open('http://answers.launchpad.dev:8085/firefox/+addquestion')
+ >>> browser.open('%s/firefox/+addquestion' % answers_url)
>>> browser.getControl('Summary').value = 'A new question'
>>> browser.getControl('Continue').click()
>>> browser.getControl('Description').value = 'More detail.'
@@ -86,7 +89,7 @@
X-RcptTo: no-priv@xxxxxxxxxxxxx
<BLANKLINE>
New question #... on Mozilla Firefox:
- http://answers.launchpad.dev:8085/firefox/+question/...
+ http://answers.launchpad.dev:.../firefox/+question/...
<BLANKLINE>
More detail.
<BLANKLINE>
@@ -125,7 +128,7 @@
X-RcptTo: anne.person@xxxxxxxxxxx
<BLANKLINE>
New question #... on Mozilla Firefox:
- http://answers.launchpad.dev:8085/firefox/+question/...
+ http://answers.launchpad.dev:.../firefox/+question/...
<BLANKLINE>
More detail.
<BLANKLINE>
@@ -154,7 +157,7 @@
sent to Anne and to the archive, via the mailing list.
>>> browser.open(
- ... 'http://launchpad.dev:8085/firefox/+spec/canvas/+addsubscriber')
+ ... '%s/firefox/+spec/canvas/+addsubscriber' % root_url)
>>> browser.getControl('Subscriber').value = 'itest-one'
>>> browser.getControl('Continue').click()
@@ -195,7 +198,7 @@
Objects.
<BLANKLINE>
--
- http://blueprints.launchpad.dev:8085/firefox/+spec/canvas
+ http://blueprints.launchpad.dev:.../firefox/+spec/canvas
_______________________________________________
Mailing list: http://launchpad.dev/~itest-one
Post to : itest-one@xxxxxxxxxxxxxxxxxxx
@@ -222,7 +225,7 @@
Objects.
<BLANKLINE>
--
- http://blueprints.launchpad.dev:8085/firefox/+spec/canvas
+ http://blueprints.launchpad.dev:.../firefox/+spec/canvas
_______________________________________________
Mailing list: http://launchpad.dev/~itest-one
Post to : itest-one@xxxxxxxxxxxxxxxxxxx
@@ -232,7 +235,7 @@
The team's contact address is set to each team member individually.
Notifications will no longer be sent to the mailing list.
- >>> browser.open('http://launchpad.dev:8085/~itest-one/+contactaddress')
+ >>> browser.open('%s/~itest-one/+contactaddress' % root_url)
>>> browser.getControl('Each member individually').selected = True
>>> browser.getControl('Change').click()
@@ -242,7 +245,7 @@
>>> [strip_label(label) for label in control.displayValue]
['Each member individually']
- >>> browser.open('http://answers.launchpad.dev:8085/firefox/+addquestion')
+ >>> browser.open('%s/firefox/+addquestion' % answers_url)
>>> browser.getControl('Summary').value = 'Another question'
>>> browser.getControl('Continue').click()
>>> browser.getControl('Description').value = 'More detail.'
=== modified file 'lib/lp/services/mailman/doc/create-lists.txt'
--- lib/lp/services/mailman/doc/create-lists.txt 2009-12-02 22:56:09 +0000
+++ lib/lp/services/mailman/doc/create-lists.txt 2010-10-18 22:52:44 +0000
@@ -5,8 +5,10 @@
No Privileges Person wants to create a mailing list on Launchpad. She first
starts by registering a team for her mailing list.
+ >>> from canonical.testing import getRootLaunchpadUrl
+ >>> root_url = getRootLaunchpadUrl()
>>> browser = Browser('no-priv@xxxxxxxxxxxxx:test')
- >>> browser.open('http://launchpad.dev:8085/people/+newteam')
+ >>> browser.open('%s/people/+newteam' % root_url)
>>> browser.getControl(name='field.name').value = 'itest-one'
>>> browser.getControl('Display Name').value = 'ITest One'
>>> browser.getControl(name='field.subscriptionpolicy').displayValue = [
=== modified file 'lib/lp/services/mailman/doc/deactivate-lists.txt'
--- lib/lp/services/mailman/doc/deactivate-lists.txt 2010-04-26 16:00:31 +0000
+++ lib/lp/services/mailman/doc/deactivate-lists.txt 2010-10-18 22:52:44 +0000
@@ -23,8 +23,10 @@
The team administrator can deactivate the list through the web.
+ >>> from canonical.testing import getRootLaunchpadUrl
+ >>> root_url = getRootLaunchpadUrl()
>>> browser = Browser('no-priv@xxxxxxxxxxxxx:test')
- >>> browser.open('http://launchpad.dev:8085/~itest-one/+mailinglist')
+ >>> browser.open('%s/~itest-one/+mailinglist' % root_url)
>>> browser.getControl('Deactivate this Mailing List').click()
>>> xmlrpc_watcher.wait_for_deactivation('itest-one')
=== modified file 'lib/lp/services/mailman/doc/decorations.txt'
--- lib/lp/services/mailman/doc/decorations.txt 2009-09-24 18:51:29 +0000
+++ lib/lp/services/mailman/doc/decorations.txt 2010-10-18 22:52:44 +0000
@@ -114,8 +114,10 @@
This url should exactly match the link given on the team's overview page.
+ >>> from canonical.testing import getRootLaunchpadUrl
+ >>> root_url = getRootLaunchpadUrl()
>>> browser = Browser('no-priv@xxxxxxxxxxxxx:test')
- >>> browser.open('http://launchpad.dev:8085/~itest-one')
+ >>> browser.open('%s/~itest-one' % root_url)
>>> browser.getLink(id='mailing-list-archive')
<Link text='View archive' url='http://lists.launchpad.dev/itest-one'>
>>> print message['list-archive']
=== modified file 'lib/lp/services/mailman/doc/modify-lists.txt'
--- lib/lp/services/mailman/doc/modify-lists.txt 2009-12-02 22:56:09 +0000
+++ lib/lp/services/mailman/doc/modify-lists.txt 2010-10-18 22:52:44 +0000
@@ -13,8 +13,10 @@
Once the list is created, the team owner can change the welcome message
through the web.
+ >>> from canonical.testing import getRootLaunchpadUrl
+ >>> root_url = getRootLaunchpadUrl()
>>> browser = Browser('no-priv@xxxxxxxxxxxxx:test')
- >>> browser.open('http://launchpad.dev:8085/~itest-one/+mailinglist')
+ >>> browser.open('%s/~itest-one/+mailinglist' % root_url)
>>> browser.getControl('Welcome message text').value = (
... 'Salutations team members!')
>>> browser.getControl('Save').click()
=== modified file 'lib/lp/services/mailman/doc/postings.txt'
--- lib/lp/services/mailman/doc/postings.txt 2010-10-14 18:42:19 +0000
+++ lib/lp/services/mailman/doc/postings.txt 2010-10-18 22:52:44 +0000
@@ -117,7 +117,7 @@
<BLANKLINE>
Subject: An unsubscribed post
Author name: Anne Person
- Author url: http://launchpad.dev:8085/~anne
+ Author url: http://launchpad.dev:.../~anne
Date: ...
Message-ID: <caribou>
<BLANKLINE>
@@ -128,7 +128,7 @@
<BLANKLINE>
To review all messages pending approval, visit:
<BLANKLINE>
- http://launchpad.dev:8085/~itest-one/+mailinglist-moderate
+ http://launchpad.dev:.../~itest-one/+mailinglist-moderate
<BLANKLINE>
Regards,
The Launchpad team
@@ -153,9 +153,10 @@
declining the message, Launchpad forgets about it, while Mailman sends a
rejection notice to Anne.
+ >>> from canonical.testing import getRootLaunchpadUrl
+ >>> root_url = getRootLaunchpadUrl()
>>> browser = Browser('no-priv@xxxxxxxxxxxxx:test')
- >>> browser.open(
- ... 'http://launchpad.dev:8085/~itest-one/+mailinglist-moderate')
+ >>> browser.open('%s/~itest-one/+mailinglist-moderate' % root_url)
>>> browser.getControl(name='field.%3Ccaribou%3E').value = [
... 'reject']
>>> browser.getControl('Moderate').click()
@@ -226,13 +227,12 @@
<BLANKLINE>
Subject: Wanna buy something?
Author name: Anne Person
- Author url: http://launchpad.dev:8085/~anne
+ Author url: http://launchpad.dev:.../~anne
Date: ...
Message-ID: <donkey>
...
- >>> browser.open(
- ... 'http://launchpad.dev:8085/~itest-one/+mailinglist-moderate')
+ >>> browser.open('%s/~itest-one/+mailinglist-moderate' % root_url)
>>> browser.getControl(name='field.%3Cdonkey%3E').value = [
... 'discard']
>>> browser.getControl('Moderate').click()
@@ -273,7 +273,7 @@
<BLANKLINE>
Subject: Another unsubscribed post
Author name: Anne Person
- Author url: http://launchpad.dev:8085/~anne
+ Author url: http://launchpad.dev:.../~anne
Date: ...
Message-ID: <elephant>
...
@@ -290,8 +290,7 @@
Hi, I am still not yet a member of this team's list.
<BLANKLINE>
- >>> browser.open(
- ... 'http://launchpad.dev:8085/~itest-one/+mailinglist-moderate')
+ >>> browser.open('%s/~itest-one/+mailinglist-moderate' % root_url)
>>> browser.getControl(name='field.%3Celephant%3E').value = [
... 'approve']
>>> browser.getControl('Moderate').click()
@@ -603,15 +602,14 @@
...
Subject: A non-team member post
Author name: Anne Person
- Author url: http://launchpad.dev:8085/~anne
+ Author url: http://launchpad.dev:.../~anne
Date: ...
Message-ID: <horse>
...
The team administrator discards the message.
- >>> browser.open(
- ... 'http://launchpad.dev:8085/~itest-one/+mailinglist-moderate')
+ >>> browser.open('%s/~itest-one/+mailinglist-moderate' % root_url)
>>> browser.getControl(name='field.%3Chorse%3E').value = [
... 'discard']
>>> browser.getControl('Moderate').click()
@@ -774,8 +772,7 @@
Should a non-team member's held post be approved, they are then allowed to
post to just that mailing list without further approval required.
- >>> browser.open(
- ... 'http://launchpad.dev:8085/~itest-one/+mailinglist-moderate')
+ >>> browser.open('%s/~itest-one/+mailinglist-moderate' % root_url)
>>> browser.getControl(name='field.%3Cmongoose%3E').value = ['approve']
>>> browser.getControl('Moderate').click()
>>> smtpd_watcher.wait_for_mbox_delivery('mongoose')
@@ -870,8 +867,7 @@
Once this message is approved, it is posted through to the mailing list.
- >>> browser.open(
- ... 'http://launchpad.dev:8085/~itest-one/+mailinglist-moderate')
+ >>> browser.open('%s/~itest-one/+mailinglist-moderate' % root_url)
>>> browser.getControl(name='field.%3Cpuma%3E').value = ['approve']
>>> browser.getControl('Moderate').click()
>>> smtpd_watcher.wait_for_mbox_delivery('puma')
=== modified file 'lib/lp/services/mailman/doc/reactivate-lists.txt'
--- lib/lp/services/mailman/doc/reactivate-lists.txt 2010-04-15 11:44:04 +0000
+++ lib/lp/services/mailman/doc/reactivate-lists.txt 2010-10-18 22:52:44 +0000
@@ -14,8 +14,10 @@
Give the mailing list a welcome message.
+ >>> from canonical.testing import getRootLaunchpadUrl
+ >>> root_url = getRootLaunchpadUrl()
>>> browser = Browser('no-priv@xxxxxxxxxxxxx:test')
- >>> browser.open('http://launchpad.dev:8085/~itest-one/+mailinglist')
+ >>> browser.open('%s/~itest-one/+mailinglist' % root_url)
>>> browser.getControl('Welcome message text').value = (
... 'Greetings team one members!')
>>> browser.getControl('Save').click()
=== modified file 'lib/lp/services/mailman/doc/recovery.txt'
--- lib/lp/services/mailman/doc/recovery.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/services/mailman/doc/recovery.txt 2010-10-18 22:52:44 +0000
@@ -13,8 +13,10 @@
Mailman and Launchpad should eventually resynchronize their state
automatically.
+ >>> from canonical.testing import getRootLaunchpadUrl
+ >>> root_url = getRootLaunchpadUrl()
>>> browser = Browser('no-priv@xxxxxxxxxxxxx:test')
- >>> browser.open('http://launchpad.dev:8085/people/+newteam')
+ >>> browser.open('%s/people/+newteam' % root_url)
>>> browser.getControl(name='field.name').value = 'itest-one'
>>> browser.getControl('Display Name').value = 'ITest One'
>>> browser.getControl(name='field.subscriptionpolicy').displayValue = [
@@ -56,7 +58,7 @@
However, if the list status on Launchpad is CONSTRUCTING, but the mailing list
does not actually exist in Mailman, then Mailman will create it.
- >>> browser.open('http://launchpad.dev:8085/people/+newteam')
+ >>> browser.open('%s/people/+newteam' % root_url)
>>> browser.getControl(name='field.name').value = 'itest-two'
>>> browser.getControl('Display Name').value = 'ITest Two'
>>> browser.getControl(name='field.subscriptionpolicy').displayValue = [
=== modified file 'lib/lp/services/mailman/testing/helpers.py'
--- lib/lp/services/mailman/testing/helpers.py 2010-08-20 20:31:18 +0000
+++ lib/lp/services/mailman/testing/helpers.py 2010-10-18 22:52:44 +0000
@@ -51,6 +51,7 @@
login,
logout,
)
+from canonical.testing import getRootLaunchpadUrl
from canonical.launchpad.testing.browser import Browser
from lp.registry.interfaces.mailinglist import IMailingListSet
from lp.registry.interfaces.person import IPersonSet
@@ -99,7 +100,7 @@
word.capitalize() for word in team_name.split('-'))
browser = Browser('no-priv@xxxxxxxxxxxxx:test')
# Create the team.
- browser.open('http://launchpad.dev:8085/people/+newteam')
+ browser.open('%s/people/+newteam' % getRootLaunchpadUrl())
browser.getControl(name='field.name').value = team_name
browser.getControl('Display Name').value = displayname
browser.getControl(name='field.subscriptionpolicy').displayValue = [
@@ -243,7 +244,7 @@
"""Like mailinglists_helper.apply_for_list() but with the right rooturl.
"""
mailinglists_helper.apply_for_list(
- browser, team_name, 'http://launchpad.dev:8085/')
+ browser, team_name, getRootLaunchpadUrl(ensureSlash=True))
def _membership_test(team_name, people, predicate):
=== modified file 'lib/lp/soyuz/windmill/testing.py'
--- lib/lp/soyuz/windmill/testing.py 2009-09-29 12:09:39 +0000
+++ lib/lp/soyuz/windmill/testing.py 2010-10-18 22:52:44 +0000
@@ -15,4 +15,5 @@
class SoyuzWindmillLayer(BaseWindmillLayer):
"""Layer for Soyuz Windmill tests."""
- base_url = 'http://launchpad.dev:8085/'
+ from canonical.testing import getRootLaunchpadUrl
+ base_url = getRootLaunchpadUrl()
=== modified file 'lib/lp/soyuz/windmill/tests/test_archive_packages.py'
--- lib/lp/soyuz/windmill/tests/test_archive_packages.py 2010-08-16 10:24:17 +0000
+++ lib/lp/soyuz/windmill/tests/test_archive_packages.py 2010-10-18 22:52:44 +0000
@@ -15,7 +15,8 @@
"""A successful request for the extra info updates the display."""
self.client.open(
- url='http://launchpad.dev:8085/~cprov/+archive/ppa/+packages')
+ url='%s/~cprov/+archive/ppa/+packages'
+ % SoyuzWindmillLayer.base_url)
self.client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
self.client.click(id="pub29-expander")
=== modified file 'lib/lp/soyuz/windmill/tests/test_archivesubscribersindex.py'
--- lib/lp/soyuz/windmill/tests/test_archivesubscribersindex.py 2010-08-20 20:31:18 +0000
+++ lib/lp/soyuz/windmill/tests/test_archivesubscribersindex.py 2010-10-18 22:52:44 +0000
@@ -64,8 +64,9 @@
self.lpuser.ensure_login(client)
- client.open(url='http://launchpad.dev:8085/~joe-bloggs/'
- '+archive/myppa/+subscriptions')
+ client.open(url='%s/~joe-bloggs/'
+ '+archive/myppa/+subscriptions'
+ % SoyuzWindmillLayer.base_url)
client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
# Click on the JS add access action.
=== modified file 'lib/lp/soyuz/windmill/tests/test_ppainlineedit.py'
--- lib/lp/soyuz/windmill/tests/test_ppainlineedit.py 2010-08-20 20:31:18 +0000
+++ lib/lp/soyuz/windmill/tests/test_ppainlineedit.py 2010-10-18 22:52:44 +0000
@@ -19,7 +19,7 @@
"""Ensure the PPA dispalyname can be edited inline."""
ppa_displayname_inline_edit_test = widgets.InlineEditorWidgetTest(
- url='http://launchpad.dev:8085/~cprov/+archive/ppa',
+ url='%s/~cprov/+archive/ppa' % SoyuzWindmillLayer.base_url,
widget_id='displayname',
expected_value='PPA for Celso Providelo',
new_value="Celso's default PPA",
=== modified file 'lib/lp/testing/__init__.py'
--- lib/lp/testing/__init__.py 2010-10-17 21:21:07 +0000
+++ lib/lp/testing/__init__.py 2010-10-18 22:52:44 +0000
@@ -720,7 +720,8 @@
# do anything before you open() something you'd be operating on the
# page that was last accessed by the previous test, which is the cause
# of things like https://launchpad.net/bugs/515494)
- self.client.open(url=u'http://launchpad.dev:8085')
+ from canonical.testing import getRootLaunchpadUrl
+ self.client.open(url=getRootLaunchpadUrl())
class YUIUnitTestCase(WindmillTestCase):
@@ -729,11 +730,13 @@
suite_name = ''
_yui_results = None
- _view_name = u'http://launchpad.dev:8085/+yui-unittest/'
def initialize(self, test_path):
self.test_path = test_path
- self.yui_runner_url = self._view_name + test_path
+ #This goes here to prevent circular import issues
+ from canonical.testing import getRootLaunchpadUrl
+ _view_name = u'%s/+yui-unittest/' % getRootLaunchpadUrl()
+ self.yui_runner_url = _view_name + test_path
def setUp(self):
super(YUIUnitTestCase, self).setUp()
=== modified file 'lib/lp/testing/factory.py'
--- lib/lp/testing/factory.py 2010-10-18 21:18:03 +0000
+++ lib/lp/testing/factory.py 2010-10-18 22:52:44 +0000
@@ -3137,8 +3137,9 @@
def makeLaunchpadService(self, person=None):
if person is None:
person = self.makePerson()
+ from canonical.testing import getRootLaunchpadUrl
launchpad = launchpadlib_for("test", person,
- service_root="http://api.launchpad.dev:8085")
+ service_root=getRootLaunchpadUrl("api"))
login_person(person)
return launchpad
=== modified file 'lib/lp/translations/windmill/testing.py'
--- lib/lp/translations/windmill/testing.py 2009-10-28 15:39:02 +0000
+++ lib/lp/translations/windmill/testing.py 2010-10-18 22:52:44 +0000
@@ -15,4 +15,5 @@
class TranslationsWindmillLayer(BaseWindmillLayer):
"""Layer for Translations Windmill tests."""
- base_url = 'http://translations.launchpad.dev:8085/'
+ from canonical.testing import getRootLaunchpadUrl
+ base_url = getRootLaunchpadUrl('translations')
=== modified file 'lib/lp/translations/windmill/tests/disabled_test_productseries_templates.py'
--- lib/lp/translations/windmill/tests/disabled_test_productseries_templates.py 2010-08-20 20:31:18 +0000
+++ lib/lp/translations/windmill/tests/disabled_test_productseries_templates.py 2010-10-18 22:52:44 +0000
@@ -48,8 +48,8 @@
* verifies that the action links of the row are deactivated;
"""
client = self.client
- url = ('http://translations.launchpad.dev:8085/evolution/trunk/'
- '+templates')
+ url = ('%s/evolution/trunk/+templates'
+ % TranslationsWindmillLayer.base_url)
user = lpuser.TRANSLATIONS_ADMIN
# Go to templates page logged in as translations admin.
client.open(url=url)
=== modified file 'lib/lp/translations/windmill/tests/test_documentation_links.py'
--- lib/lp/translations/windmill/tests/test_documentation_links.py 2010-08-30 21:54:56 +0000
+++ lib/lp/translations/windmill/tests/test_documentation_links.py 2010-10-18 22:52:44 +0000
@@ -66,8 +66,8 @@
user.ensure_login(client)
client.open(
- url=(u'http://translations.launchpad.dev:8085/test-product/trunk'
- u'/+pots/template/es/'))
+ url=(u'%s/test-product/trunk/+pots/template/es/'
+ % TranslationsWindmillLayer.base_url))
client.waits.forPageLoad(timeout=u'20000')
# Make sure notification box is shown.
@@ -94,8 +94,8 @@
# notification box is visible even though user dismissed Spanish
# translation notification.
client.open(
- url=(u'http://translations.launchpad.dev:8085/test-product/trunk'
- u'/+pots/template/ca/'))
+ url=(u'%s/test-product/trunk/+pots/template/ca/'
+ % TranslationsWindmillLayer.base_url))
client.waits.forPageLoad(timeout=u'20000')
client.asserts.assertNotProperty(
classname=u'important-notice-container',
=== modified file 'lib/lp/translations/windmill/tests/test_import_queue.py'
--- lib/lp/translations/windmill/tests/test_import_queue.py 2010-08-30 21:54:56 +0000
+++ lib/lp/translations/windmill/tests/test_import_queue.py 2010-10-18 22:52:44 +0000
@@ -78,7 +78,7 @@
def test_import_queue_entry(self):
"""Tests that import queue entry fields behave correctly."""
client = self.client
- start_url = 'http://translations.launchpad.dev:8085/+imports/1'
+ start_url = '%s/+imports/1' % TranslationsWindmillLayer.base_url
user = lpuser.TRANSLATIONS_ADMIN
# Go to import queue page logged in as translations admin.
user.ensure_login(client)
=== modified file 'lib/lp/translations/windmill/tests/test_languages.py'
--- lib/lp/translations/windmill/tests/test_languages.py 2010-08-20 20:31:18 +0000
+++ lib/lp/translations/windmill/tests/test_languages.py 2010-10-18 22:52:44 +0000
@@ -53,7 +53,7 @@
French, because neither its name nor language code contain 'de'.
"""
client = self.client
- start_url = 'http://translations.launchpad.dev:8085/+languages'
+ start_url = '%s/+languages' % TranslationsWindmillLayer.base_url
# Go to the languages page
self.client.open(url=start_url)
self.client.waits.forPageLoad(timeout=PAGE_LOAD)
=== modified file 'lib/lp/translations/windmill/tests/test_pofile_translate.py'
--- lib/lp/translations/windmill/tests/test_pofile_translate.py 2010-08-20 20:31:18 +0000
+++ lib/lp/translations/windmill/tests/test_pofile_translate.py 2010-10-18 22:52:44 +0000
@@ -65,26 +65,26 @@
self.test_user = lpuser.TRANSLATIONS_ADMIN
# Test the zoom out view for Evolution trunk Spanish (es).
- start_url = ('http://translations.launchpad.dev:8085/'
- 'evolution/trunk/+pots/evolution-2.2/es/+translate')
+ start_url = ('%s/evolution/trunk/+pots/evolution-2.2/es/+translate'
+ % TranslationsWindmillLayer.base_url)
new_translation_id = u'msgset_1_es_translation_0_new'
new_translation_select_id = u'msgset_1_es_translation_0_new_select'
self._checkTranslationAutoselect(
start_url, new_translation_id, new_translation_select_id)
# Test the zoom in view for Evolution trunk Brazilian (pt_BR).
- start_url = ('http://translations.launchpad.dev:8085/'
- 'evolution/trunk/+pots/evolution-2.2/'
- 'pt_BR/1/+translate')
+ start_url = ('%s/evolution/trunk/+pots/evolution-2.2/'
+ 'pt_BR/1/+translate'
+ % TranslationsWindmillLayer.base_url )
new_translation_id = u'msgset_1_pt_BR_translation_0_new'
new_translation_select_id = u'msgset_1_pt_BR_translation_0_new_select'
self._checkTranslationAutoselect(
start_url, new_translation_id, new_translation_select_id)
# Test the zoom out view for Ubuntu Hoary Brazilian (pt_BR).
- start_url = ('http://translations.launchpad.dev:8085/'
- 'ubuntu/hoary/+source/mozilla/+pots/pkgconf-mozilla/'
- 'pt_BR/1/+translate')
+ start_url = ('%s/ubuntu/hoary/+source/mozilla/+pots/pkgconf-mozilla/'
+ 'pt_BR/1/+translate'
+ % TranslationsWindmillLayer.base_url)
new_translation_id = u'msgset_152_pt_BR_translation_0_new'
new_translation_select_id = (u'msgset_152_pt_BR'
'_translation_0_new_select')
@@ -108,8 +108,8 @@
self.test_user = lpuser.TRANSLATIONS_ADMIN
# Test the zoom out view for Evolution trunk Spanish (es).
- url = ('http://translations.launchpad.dev:8085/'
- 'evolution/trunk/+pots/evolution-2.2/es/5/+translate')
+ url = ('%s/evolution/trunk/+pots/evolution-2.2/es/5/+translate'
+ % TranslationsWindmillLayer.base_url)
dismiss_id = u'msgset_5_dismiss'
force_suggestion_id = u'msgset_5_force_suggestion'
@@ -164,8 +164,8 @@
transaction.commit()
logout()
- url = ('http://translations.launchpad.dev:8085/'
- '%s/%s/+pots/%s/pt_BR/1/+translate' % (
+ url = ('%s/%s/%s/+pots/%s/pt_BR/1/+translate' % (
+ TranslationsWindmillLayer.base_url,
potemplate.product.name,
potemplate.productseries.name,
potemplate.name))
@@ -310,9 +310,9 @@
# Go to the zoom in page for a translation with plural forms.
self.client.open(
- url='http://translations.launchpad.dev:8085/'
- 'ubuntu/hoary/+source/evolution/+pots/'
- 'evolution-2.2/es/15/+translate')
+ url='%s/ubuntu/hoary/+source/evolution/+pots/'
+ 'evolution-2.2/es/15/+translate'
+ % TranslationsWindmillLayer.base_url)
self.client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
user.ensure_login(self.client)
@@ -333,9 +333,9 @@
# pt_BR is a language code using the same delimiter as HTTP form
# fields and are prone to errors.
self.client.open(
- url='http://translations.launchpad.dev:8085/'
- 'ubuntu/hoary/+source/evolution/+pots/'
- 'evolution-2.2/pt_BR/15/+translate')
+ url='%s/ubuntu/hoary/+source/evolution/+pots/'
+ 'evolution-2.2/pt_BR/15/+translate'
+ % TranslationsWindmillLayer.base_url)
self.client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
checkbox = u'msgset_144_force_suggestion'
@@ -354,9 +354,9 @@
# Go to the zoom in page for a translation without plural forms.
self.client.open(
- url='http://translations.launchpad.dev:8085/'
- 'ubuntu/hoary/+source/evolution/+pots/'
- 'evolution-2.2/es/19/+translate')
+ url='%s/ubuntu/hoary/+source/evolution/+pots/'
+ 'evolution-2.2/es/19/+translate'
+ % TranslationsWindmillLayer.base_url)
self.client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
checkbox = u'msgset_148_force_suggestion'
@@ -370,9 +370,9 @@
# Go to the zoom out page for some translations.
self.client.open(
- url='http://translations.launchpad.dev:8085/'
- 'ubuntu/hoary/+source/evolution/+pots/'
- 'evolution-2.2/es/+translate')
+ url='%s/ubuntu/hoary/+source/evolution/+pots/'
+ 'evolution-2.2/es/+translate'
+ % TranslationsWindmillLayer.base_url)
self.client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
checkbox = u'msgset_130_force_suggestion'
@@ -426,8 +426,8 @@
"""
self.client.open(
- url='http://translations.launchpad.dev:8085/'
- 'evolution/trunk/+pots/evolution-2.2/pt_BR/1/+translate')
+ url='%s/evolution/trunk/+pots/evolution-2.2/pt_BR/1/+translate'
+ % TranslationsWindmillLayer.base_url)
self.client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
self.test_user.ensure_login(self.client)
@@ -445,8 +445,8 @@
"""
self.client.open(
- url='http://translations.launchpad.dev:8085'
- '/evolution/trunk/+pots/evolution-2.2/pt_BR/1/+translate')
+ url='%s/evolution/trunk/+pots/evolution-2.2/pt_BR/1/+translate'
+ % TranslationsWindmillLayer.base_url)
self.client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
self.test_user.ensure_login(self.client)
=== modified file 'lib/lp/translations/windmill/tests/test_serieslanguages.py'
--- lib/lp/translations/windmill/tests/test_serieslanguages.py 2010-08-20 20:31:18 +0000
+++ lib/lp/translations/windmill/tests/test_serieslanguages.py 2010-10-18 22:52:44 +0000
@@ -47,7 +47,7 @@
person having Catalan and Spanish as preferred languages.
"""
client = self.client
- start_url = 'http://translations.launchpad.dev:8085/ubuntu'
+ start_url = '%s/ubuntu' % TranslationsWindmillLayer.base_url
user = lpuser.TRANSLATIONS_ADMIN
# Go to the distribution languages page
self.client.open(url=start_url)
@@ -78,4 +78,3 @@
u'French': True,
u'Croatian': True,
})
-