Merge lp:~matiasb/u1-test-utils/update-sso-create-account into lp:u1-test-utils
- update-sso-create-account
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Matias Bordese |
Approved revision: | 102 |
Merged at revision: | 100 |
Proposed branch: | lp:~matiasb/u1-test-utils/update-sso-create-account |
Merge into: | lp:u1-test-utils |
Diff against target: |
210 lines (+20/-81) 7 files modified
fabfile/environment.py (+3/-0) setup_vm/bin/setup_vm.py (+6/-6) u1testutils/pay/__init__.py (+4/-4) u1testutils/sso/environment.py (+0/-24) u1testutils/sso/selftests/acceptance/test_sst_helpers.py (+4/-40) u1testutils/sso/sst/__init__.py (+2/-5) u1testutils/sst/__init__.py (+1/-2) |
To merge this branch: | bzr merge lp:~matiasb/u1-test-utils/update-sso-create-account |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Fabián Ezequiel Gallina (community) | Approve | ||
Review via email: mp+256184@code.launchpad.net |
Commit message
Updated SSO create account helper, no brand checking.
Description of the change
Ubuntu One Auto Pilot (otto-pilot) wrote : | # |
The attempt to merge lp:~matiasb/u1-test-utils/update-sso-create-account 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.
Installing pip....
[localhost] local: . /mnt/tarmac/
Downloading/
Checking out bzr+ssh:
Running setup.py egg_info for package from bzr+ssh:
Downloading/
Checking out http://
Running setup.py egg_info for package from bzr+http://
warning: no previously-included files matching '*.pyc' found anywhere in distribution
Downloading/
Checking out http://
Running setup.py egg_info for package from bzr+http://
warning: no files found matching 'testproj.
Downloading/
Checking out http://
Running setup.py egg_info for package from bzr+http://
Downloading/
Running setup.py egg_info for package beautifulsoup4
Downloading/
Running setup.py egg_info for package django
Downloading/
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 ...
Ubuntu One Auto Pilot (otto-pilot) wrote : | # |
The attempt to merge lp:~matiasb/u1-test-utils/update-sso-create-account 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.
Installing pip....
[localhost] local: . /mnt/tarmac/
Downloading/
Running setup.py egg_info for package distribute
Downloading/
Running setup.py egg_info for package setuptools
Installing collected packages: distribute, setuptools
Found existing installation: distribute 0.6.24
Uninstalling distribute:
Successfully uninstalled distribute
Running setup.py install for distribute
Running setup.py install for setuptools
Installing easy_install script to /mnt/tarmac/
Installing easy_install-2.7 script to /mnt/tarmac/
Successfully installed distribute setuptools
Cleaning up...
[localhost] local: . /mnt/tarmac/
Downloading/
Checking out bzr+ssh:
Running setup.py egg_info for package from bzr+ssh:
Downloading/
Checking out http://
Running setup.py egg_info for package from bzr+http://
warning: no previously-included files matching '*.pyc' found anywhere in distribution
Downloading/
Checking out http://
Running setup.py egg_info for package from bzr+http://
warning: no files found matching 'testproj.
Downloading/
Preview Diff
1 | === modified file 'fabfile/environment.py' |
2 | --- fabfile/environment.py 2013-09-25 16:51:15 +0000 |
3 | +++ fabfile/environment.py 2015-04-14 18:58:52 +0000 |
4 | @@ -68,6 +68,9 @@ |
5 | |
6 | |
7 | def _install_dependencies(): |
8 | + # it's possible to get "ImportError: No module named setuptools" |
9 | + # when using pip<1.4 to upgrade a package that depends on setuptools. |
10 | + run_in_virtualenv_local('pip install -U setuptools', capture=False) |
11 | run_in_virtualenv_local( |
12 | 'pip install -U -r requirements.txt', capture=False) |
13 | |
14 | |
15 | === modified file 'setup_vm/bin/setup_vm.py' |
16 | --- setup_vm/bin/setup_vm.py 2014-07-30 14:49:39 +0000 |
17 | +++ setup_vm/bin/setup_vm.py 2015-04-14 18:58:52 +0000 |
18 | @@ -461,10 +461,10 @@ |
19 | elif line.startswith(' * Will now halt'): |
20 | # That's our final_message, we're done |
21 | return |
22 | - elif ('Failed loading yaml blob' in line |
23 | - or 'Unhandled non-multipart userdata starting' in line |
24 | - or 'failed to render string to stdout:' in line |
25 | - or 'Failed loading of cloud config' in line): |
26 | + elif ('Failed loading yaml blob' in line or |
27 | + 'Unhandled non-multipart userdata starting' in line or |
28 | + 'failed to render string to stdout:' in line or |
29 | + 'Failed loading of cloud config' in line): |
30 | raise CloudInitError(line) |
31 | |
32 | |
33 | @@ -776,8 +776,8 @@ |
34 | parts.append({'content': '#cloud-boothook\n' + hook}) |
35 | |
36 | def dump(self): |
37 | - parts = [{'content': '#cloud-config\n' |
38 | - + yaml.safe_dump(self.cloud_config)}] |
39 | + parts = [{'content': '#cloud-config\n' + |
40 | + yaml.safe_dump(self.cloud_config)}] |
41 | self.add_boot_hook(parts, self.root_hook) |
42 | self.add_boot_hook(parts, self.ubuntu_hook) |
43 | self.add_boot_hook(parts, self.launchpad_hook) |
44 | |
45 | === modified file 'u1testutils/pay/__init__.py' |
46 | --- u1testutils/pay/__init__.py 2013-05-10 01:11:17 +0000 |
47 | +++ u1testutils/pay/__init__.py 2015-04-14 18:58:52 +0000 |
48 | @@ -12,12 +12,12 @@ |
49 | # You should have received a copy of the GNU General Public License along |
50 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
51 | |
52 | +import data |
53 | +import environment |
54 | +from api import APIClient |
55 | + |
56 | __all__ = [ |
57 | 'APIClient', |
58 | 'data', |
59 | 'environment', |
60 | ] |
61 | - |
62 | -import data |
63 | -import environment |
64 | -from api import APIClient |
65 | |
66 | === modified file 'u1testutils/sso/environment.py' |
67 | --- u1testutils/sso/environment.py 2013-06-14 17:20:49 +0000 |
68 | +++ u1testutils/sso/environment.py 2015-04-14 18:58:52 +0000 |
69 | @@ -14,33 +14,9 @@ |
70 | |
71 | from __future__ import absolute_import |
72 | |
73 | -import sst.actions |
74 | - |
75 | from django.conf import settings |
76 | |
77 | |
78 | def get_sso_base_url(default='http://localhost:8000'): |
79 | base_url = getattr(settings, 'OPENID_SSO_SERVER_URL', default).rstrip('/') |
80 | return base_url |
81 | - |
82 | - |
83 | -# this is a temporarly helper so we can detect brands at UI rendering time |
84 | -# since we can not access flags properly from within the acceptance run |
85 | -def get_current_brand(): |
86 | - try: |
87 | - sst.actions.get_element_by_css('*[data-qa-id="brand_ubuntuone"]') |
88 | - except: |
89 | - pass |
90 | - else: |
91 | - return 'ubuntuone' |
92 | - |
93 | - try: |
94 | - sst.actions.get_element_by_css('*[data-qa-id="brand_launchpad"]') |
95 | - except: |
96 | - pass |
97 | - else: |
98 | - return 'launchpad' |
99 | - |
100 | - # if all the above failed, the following must succeed |
101 | - sst.actions.get_element_by_css('*[data-qa-id="brand_ubuntu"]') |
102 | - return 'ubuntu' |
103 | |
104 | === modified file 'u1testutils/sso/selftests/acceptance/test_sst_helpers.py' |
105 | --- u1testutils/sso/selftests/acceptance/test_sst_helpers.py 2013-08-13 15:16:39 +0000 |
106 | +++ u1testutils/sso/selftests/acceptance/test_sst_helpers.py 2015-04-14 18:58:52 +0000 |
107 | @@ -35,28 +35,6 @@ |
108 | """ |
109 | ) |
110 | |
111 | -_LOGIN_FROM_REDIRECT_PAGE_SOURCE = ( |
112 | - """ |
113 | - <html data-qa-id="login"> |
114 | - <head> |
115 | - <title>Log in</title> |
116 | - </head> |
117 | - <span data-qa-id="brand_ubuntu" /> |
118 | - <form data-qa-id="login_form" action="{login_form_submit_link}" |
119 | - method="get" > |
120 | - <input id="id_email" type="email" /> |
121 | - <input id="id_password" type="password" /> |
122 | - <button data-qa-id="login_button" type="submit"> |
123 | - Log in |
124 | - </button> |
125 | - </form> |
126 | - <a href="{create_account_link}" data-qa-id="create_account_link"> |
127 | - create account |
128 | - </a> |
129 | - </html> |
130 | - """ |
131 | -) |
132 | - |
133 | _SITE_NOT_RECOGNIZED_PAGE_SOURCE = ( |
134 | """ |
135 | <html data-qa-id="decide"> |
136 | @@ -177,16 +155,10 @@ |
137 | return page_path |
138 | |
139 | def _write_login_and_create_account_pages(self, next_page_path): |
140 | - if self.brand == 'ubuntuone': |
141 | - create_account_path = self._write_fake_unified_create_account_page( |
142 | - next_page_path) |
143 | - self._write_fake_unified_login_page( |
144 | - next_page_path, create_account_path) |
145 | - else: |
146 | - create_account_path = self._write_fake_create_account_page( |
147 | - next_page_path) |
148 | - self._write_fake_login_page( |
149 | - next_page_path, create_account_path) |
150 | + create_account_path = self._write_fake_unified_create_account_page( |
151 | + next_page_path) |
152 | + self._write_fake_unified_login_page( |
153 | + next_page_path, create_account_path) |
154 | |
155 | def _write_fake_unified_create_account_page(self, next_page_path): |
156 | source = _UNIFIED_CREATE_ACCOUNT_FROM_REDIRECT_PAGE_SOURCE |
157 | @@ -214,14 +186,6 @@ |
158 | path, source, qa_anchor, |
159 | create_account_form_submit_link=next_page_path) |
160 | |
161 | - def _write_fake_login_page(self, next_page_path, create_account_path): |
162 | - source = _LOGIN_FROM_REDIRECT_PAGE_SOURCE |
163 | - path = '+decide' |
164 | - qa_anchor = 'login' |
165 | - return self._write_fake_page_with_token( |
166 | - path, source, qa_anchor, login_form_submit_link=next_page_path, |
167 | - create_account_link=create_account_path) |
168 | - |
169 | def __exit__(self, exc_type, exc_val, exc_tb): |
170 | shutil.rmtree(self.temp_directory) |
171 | |
172 | |
173 | === modified file 'u1testutils/sso/sst/__init__.py' |
174 | --- u1testutils/sso/sst/__init__.py 2013-07-06 07:05:26 +0000 |
175 | +++ u1testutils/sso/sst/__init__.py 2015-04-14 18:58:52 +0000 |
176 | @@ -16,7 +16,7 @@ |
177 | |
178 | import sst.actions |
179 | |
180 | -from u1testutils.sso import environment, mail |
181 | +from u1testutils.sso import mail |
182 | from u1testutils.sso.sst import pages |
183 | |
184 | |
185 | @@ -38,10 +38,7 @@ |
186 | information will be send to it. Default is True. |
187 | |
188 | """ |
189 | - if environment.get_current_brand() == 'ubuntuone': |
190 | - log_in = pages.UnifiedLogInCreateAccountFromRedirect() |
191 | - else: |
192 | - log_in = pages.LogInFromRedirect() |
193 | + log_in = pages.UnifiedLogInCreateAccountFromRedirect() |
194 | create_account = log_in.go_to_create_new_account() |
195 | create_account.create_ubuntu_sso_account(user) |
196 | |
197 | |
198 | === modified file 'u1testutils/sst/__init__.py' |
199 | --- u1testutils/sst/__init__.py 2014-06-19 13:22:31 +0000 |
200 | +++ u1testutils/sst/__init__.py 2015-04-14 18:58:52 +0000 |
201 | @@ -158,8 +158,7 @@ |
202 | ', '.join(expected_texts), ', '.join(elements_text)) |
203 | |
204 | def _get_elements_text(self, tag=None, css_class=None): |
205 | - get_text = lambda x: x.text |
206 | - return map(get_text, sst.actions.get_elements( |
207 | + return map(lambda x: x.text, sst.actions.get_elements( |
208 | tag=tag, css_class=css_class)) |
209 | |
210 | def assert_headings2(self): |
lgtm