Merge lp:~wesmason/u1-test-utils/fixes-for-django1.6 into lp:u1-test-utils

Proposed by Wes Mason
Status: Merged
Approved by: Wes Mason
Approved revision: 100
Merged at revision: 99
Proposed branch: lp:~wesmason/u1-test-utils/fixes-for-django1.6
Merge into: lp:u1-test-utils
Diff against target: 107 lines (+23/-17)
3 files modified
setup_vm/bin/setup_vm.py (+6/-5)
setup_vm/tests/test_setup_vm.py (+15/-11)
u1testutils/sst/__init__.py (+2/-1)
To merge this branch: bzr merge lp:~wesmason/u1-test-utils/fixes-for-django1.6
Reviewer Review Type Date Requested Status
Ricardo Kirkner (community) Approve
Review via email: mp+228840@code.launchpad.net

Commit message

Add unquoting of current_path for Django 1.6+ compatibility as paths are now returned percent encoded

Description of the change

In django 1.6 paths from urlconf are returned pre-RFC-1738-percent-encoded, and this screws up the path mapping for SST tests.

I've doing a simple unquote which catches all the cases I could throw it at (at least from SSO), and doesn't seem to add any regression issues when I use the branch with a django 1.5.x project (e.g. un-upgraded SSO).

To post a comment you must log in.
Revision history for this message
Ricardo Kirkner (ricardokirkner) wrote :

LGTM

review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (47.6 KiB)

The attempt to merge lp:~wesmason/u1-test-utils/fixes-for-django1.6 into lp:u1-test-utils failed. Below is the output from the failed tests.

Setting up the virtual environment.
[localhost] local: which virtualenv
[localhost] local: /usr/bin/python /usr/bin/virtualenv --version
[localhost] local: /usr/bin/python /usr/bin/virtualenv --distribute --clear --no-site-packages .env
The --no-site-packages flag is deprecated; it is now the default behavior.
Not deleting .env/bin
New python executable in .env/bin/python
Installing distribute.............................................................................................................................................................................................done.
Installing pip...............done.
[localhost] local: . /mnt/tarmac/cache/u1-test-utils/trunk/.env/bin/activate && pip install -U -r requirements.txt
Downloading/unpacking bzr+ssh://bazaar.launchpad.net/~bloodearnest/localmail/trunk@36 (from -r requirements.txt (line 9))
  Checking out bzr+ssh://bazaar.launchpad.net/~bloodearnest/localmail/trunk (to revision 36) to /tmp/pip-dFpy9z-build
  Running setup.py egg_info for package from bzr+ssh://bazaar.launchpad.net/~bloodearnest/localmail/trunk@36

Downloading/unpacking bzr+http://bazaar.launchpad.net/~ubuntuone-hackers/payclient/trunk@4 (from -r requirements.txt (line 10))
  Checking out http://bazaar.launchpad.net/~ubuntuone-hackers/payclient/trunk (to revision 4) to /tmp/pip-WTY2mS-build
  Running setup.py egg_info for package from bzr+http://bazaar.launchpad.net/~ubuntuone-hackers/payclient/trunk@4

    warning: no previously-included files matching '*.pyc' found anywhere in distribution
Downloading/unpacking bzr+http://bazaar.launchpad.net/~canonical-isd-qa/selenium-simple-test/trunk@tag:sst-0.2.4 (from -r requirements.txt (line 11))
  Checking out http://bazaar.launchpad.net/~canonical-isd-qa/selenium-simple-test/trunk (to revision tag:sst-0.2.4) to /tmp/pip-T3qRri-build
  Running setup.py egg_info for package from bzr+http://bazaar.launchpad.net/~canonical-isd-qa/selenium-simple-test/trunk@tag:sst-0.2.4

    warning: no files found matching 'testproj.db.original' under directory 'src/testproject'
Downloading/unpacking bzr+http://bazaar.launchpad.net/~canonical-isd-hackers/canonical-identity-provider/ssoclient@3 (from -r requirements.txt (line 12))
  Checking out http://bazaar.launchpad.net/~canonical-isd-hackers/canonical-identity-provider/ssoclient (to revision 3) to /tmp/pip-F9n5N0-build
  Running setup.py egg_info for package from bzr+http://bazaar.launchpad.net/~canonical-isd-hackers/canonical-identity-provider/ssoclient@3

Downloading/unpacking beautifulsoup4 (from -r requirements.txt (line 2))
  Running setup.py egg_info for package beautifulsoup4

Downloading/unpacking django==1.4 (from -r requirements.txt (line 3))
  Running setup.py egg_info for package django

Downloading/unpacking mock (from -r requirements.txt (line 4))
  Running setup.py egg_info for package mock

    warning: no files found matching '*.png' under directory 'docs'
    warning: no files found matching '*.css' under directory 'docs'
    warning: no files found match...

100. By Wes Mason

PEP8 fixeseseses

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'setup_vm/bin/setup_vm.py'
2--- setup_vm/bin/setup_vm.py 2013-08-09 09:35:59 +0000
3+++ setup_vm/bin/setup_vm.py 2014-07-30 14:50:22 +0000
4@@ -20,7 +20,7 @@
5 registry,
6 transport,
7 urlutils,
8- )
9+)
10 import yaml
11
12 # Work around a bug in bzrlib.config forbidding some constructs in templates.
13@@ -888,9 +888,10 @@
14 console = FileMonitor(self._console_path)
15 try:
16 for line in console.parse():
17-# FIXME: We need some way to activate this dynamically (conf var defaulting to
18-# env var OR cmdline parameter ? -- vila 2013-02-11
19-# print "read: [%s]" % (line,) # so useful for debug...
20+ # FIXME: We need some way to activate this dynamically (conf
21+ # var defaulting to env var OR cmdline parameter ?
22+ # -- vila 2013-02-11
23+ # print "read: [%s]" % (line,) # so useful for debug...
24 pass
25 except (ConsoleEOFError, CloudInitError):
26 # FIXME: No test covers this path -- vila 2013-02-15
27@@ -1084,7 +1085,7 @@
28 '--disk', 'path=%s' % (self._seed_path,),
29 # We just boot, cloud-init will handle the installs we need
30 '--boot', 'hd', '--hvm',
31- ]
32+ ]
33 run_subprocess(virt_install)
34 self.parse_console_during_install(virt_install)
35 # We've seen the console signaling halt, but the vm will need a bit
36
37=== modified file 'setup_vm/tests/test_setup_vm.py'
38--- setup_vm/tests/test_setup_vm.py 2013-08-13 16:02:29 +0000
39+++ setup_vm/tests/test_setup_vm.py 2014-07-30 14:50:22 +0000
40@@ -162,11 +162,11 @@
41
42 class TestDownload(TestCaseWithHome):
43
44-# FIXME: Needs parametrization against
45-# vm.{cloud_image_name|cloud_tarball_name|iso_name} and
46-# {download_iso|download_cloud_image|download_cloud_tarball} {Lxc|Kvm}... May
47-# be we just need to test _download_in_cache() now that it's implemented at Vm
48-# level and be done -- vila 2013-08-06
49+ # FIXME: Needs parametrization agains
50+ # vm.{cloud_image_name|cloud_tarball_name|iso_name} an
51+ # {download_iso|download_cloud_image|download_cloud_tarball} {Lxc|Kvm}...
52+ # Maybe we just need to test _download_in_cache() now that it's implemented
53+ # at V level and be done -- vila 2013-08-06
54
55 def setUp(self):
56 tests.requires_feature(self, tests.use_sudo_for_tests_feature)
57@@ -544,9 +544,11 @@
58 chmod 0700 ~ubuntu/setup_vm_post_install
59 ''', self.ci_data.ubuntu_hook)
60 # The command is run as root, so we need to 'su ubuntu' first
61- self.assertEqual([['su', '-l',
62- '-c', '~ubuntu/setup_vm_post_install',
63- 'ubuntu']],
64+ self.assertEqual([['su',
65+ '-l',
66+ '-c',
67+ '~ubuntu/setup_vm_post_install',
68+ 'ubuntu']],
69 self.ci_data.cloud_config['runcmd'])
70
71 def test_uploaded_scripts(self):
72@@ -579,9 +581,11 @@
73 chmod 0700 ~ubuntu/setup_vm_uploads
74 ''',
75 self.ci_data.uploaded_scripts_hook)
76- self.assertEqual([['su', '-l',
77- '-c', '~ubuntu/setup_vm_uploads',
78- 'ubuntu']],
79+ self.assertEqual([['su',
80+ '-l',
81+ '-c',
82+ '~ubuntu/setup_vm_uploads',
83+ 'ubuntu']],
84 self.ci_data.cloud_config['runcmd'])
85
86
87
88=== modified file 'u1testutils/sst/__init__.py'
89--- u1testutils/sst/__init__.py 2013-07-03 07:22:10 +0000
90+++ u1testutils/sst/__init__.py 2014-07-30 14:50:22 +0000
91@@ -19,6 +19,7 @@
92 import sst.actions
93
94 from functools import wraps
95+from urllib2 import unquote
96
97
98 logger = logging.getLogger('User test')
99@@ -143,7 +144,7 @@
100
101 def _get_current_url_path(self):
102 current_url = sst.actions.get_current_url()
103- return urlparse.urlparse(current_url).path
104+ return unquote(urlparse.urlparse(current_url).path)
105
106 def assert_headings1(self):
107 """Assert the h1 elements of the page."""

Subscribers

People subscribed via source and target branches

to all changes: