Merge lp:~diegosarmentero/ubuntu-sso-client/tests-broken into lp:ubuntu-sso-client
- tests-broken
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Natalia Bidart | ||||
Approved revision: | 811 | ||||
Merged at revision: | 806 | ||||
Proposed branch: | lp:~diegosarmentero/ubuntu-sso-client/tests-broken | ||||
Merge into: | lp:ubuntu-sso-client | ||||
Diff against target: |
938 lines (+146/-73) 14 files modified
ubuntu_sso/gtk/tests/test_gui.py (+35/-26) ubuntu_sso/keyring/tests/test_linux.py (+2/-0) ubuntu_sso/keyring/tests/test_windows.py (+3/-1) ubuntu_sso/main/tests/test_linux.py (+17/-6) ubuntu_sso/main/tests/test_windows.py (+10/-5) ubuntu_sso/qt/tests/test_common.py (+3/-1) ubuntu_sso/qt/tests/test_controllers.py (+39/-21) ubuntu_sso/qt/tests/test_reset_password.py (+3/-1) ubuntu_sso/tests/__init__.py (+3/-1) ubuntu_sso/tests/test_account.py (+7/-2) ubuntu_sso/tests/test_credentials.py (+10/-8) ubuntu_sso/utils/tests/test_oauth_headers.py (+2/-0) ubuntu_sso/utils/tests/test_tcpactivation.py (+10/-0) ubuntu_sso/utils/tests/test_txsecrets.py (+2/-1) |
||||
To merge this branch: | bzr merge lp:~diegosarmentero/ubuntu-sso-client/tests-broken | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Natalia Bidart (community) | Approve | ||
Manuel de la Peña (community) | Approve | ||
Review via email: mp+80596@code.launchpad.net |
Commit message
Fixed Tests (LP: #882518).
Description of the change
Fixed Tests (LP: #882518).
- 806. By Diego Sarmentero
-
Removing setUp and tearDown where is not needed.
Manuel de la Peña (mandel) : | # |
Natalia Bidart (nataliabidart) wrote : | # |
Qt test are failing with:
CurrentUserCo
test_connect_ui ... Traceback (most recent call last):
File "/usr/lib/
result = g.send(result)
exceptions.
[ERROR]
test_login ... Traceback (most recent call last):
File "/usr/lib/
result = g.send(result)
exceptions.
[ERROR]
test_
File "/usr/lib/
result = g.send(result)
exceptions.
[ERROR]
test_
File "/usr/lib/
result = g.send(result)
exceptions.
[ERROR]
test_setup_ui ... Traceback (most recent call last):
File "/usr/lib/
result = g.send(result)
exceptions.
[ERROR]
test_
File "/usr/lib/
result = g.send(result)
exceptions.
[ERROR]
test_
File "/usr/lib/
result = g.send(result)
exceptions.
[ERROR]
- 807. By Diego Sarmentero
-
Fixed tests.
Natalia Bidart (nataliabidart) wrote : | # |
Error on windows...
Traceback (most recent call last):
File "C:\Python27\
main()
File "C:\Python27\
TestRunner(
File "C:\Python27\
options.
File "C:\Python27\
module_suite = self._load_
File "C:\Python27\
module = __import__(modpath, None, None, [""])
File "E:\ussoc\
e 289
return defer.gatherRes
SyntaxError: 'return' with argument inside generator
- 808. By Diego Sarmentero
-
Fixing tests.
- 809. By Diego Sarmentero
-
Fixing tests
- 810. By Diego Sarmentero
-
Fixed tests.
Natalia Bidart (nataliabidart) wrote : | # |
* You have my approve, but please before merging remove the following tearDowns:
@defer.
def tearDown(self):
"""Clean up."""
yield super(BasicTest
@defer.
def tearDown(self):
"""Clean up."""
self.entry = None
yield super(LabeledEn
* Also, this setUp is undeeded:
@defer.
def setUp(self):
"""Set up."""
yield super(Credentia
* No need to add docstring for setUp or tearDown.
* Please remove the addings:
- 811. By Diego Sarmentero
-
Removing unnecessary lines.
Diego Sarmentero (diegosarmentero) wrote : | # |
> * You have my approve, but please before merging remove the following
> tearDowns:
>
> @defer.
> def tearDown(self):
> """Clean up."""
> yield super(BasicTest
> self._called = False
>
> @defer.
> def tearDown(self):
> """Clean up."""
> self.entry = None
> yield super(LabeledEn
>
> * Also, this setUp is undeeded:
>
> @defer.
> def setUp(self):
> """Set up."""
> yield super(Credentia
>
> * No need to add docstring for setUp or tearDown.
>
> * Please remove the addings:
>
> self.addCleanup
> self.addCleanup
Fixed
Natalia Bidart (nataliabidart) wrote : | # |
Looks good!
Preview Diff
1 | === modified file 'ubuntu_sso/gtk/tests/test_gui.py' | |||
2 | --- ubuntu_sso/gtk/tests/test_gui.py 2011-09-21 17:10:14 +0000 | |||
3 | +++ ubuntu_sso/gtk/tests/test_gui.py 2011-11-02 16:59:23 +0000 | |||
4 | @@ -29,6 +29,7 @@ | |||
5 | 29 | import gtk | 29 | import gtk |
6 | 30 | import webkit | 30 | import webkit |
7 | 31 | 31 | ||
8 | 32 | from twisted.internet import defer | ||
9 | 32 | from twisted.trial.unittest import TestCase | 33 | from twisted.trial.unittest import TestCase |
10 | 33 | from ubuntuone.devtools.handlers import MementoHandler | 34 | from ubuntuone.devtools.handlers import MementoHandler |
11 | 34 | 35 | ||
12 | @@ -158,18 +159,16 @@ | |||
13 | 158 | class BasicTestCase(TestCase): | 159 | class BasicTestCase(TestCase): |
14 | 159 | """Test case with a helper tracker.""" | 160 | """Test case with a helper tracker.""" |
15 | 160 | 161 | ||
16 | 162 | @defer.inlineCallbacks | ||
17 | 161 | def setUp(self): | 163 | def setUp(self): |
18 | 162 | """Init.""" | 164 | """Init.""" |
19 | 165 | yield super(BasicTestCase, self).setUp() | ||
20 | 163 | self._called = False # helper | 166 | self._called = False # helper |
21 | 164 | 167 | ||
22 | 165 | self.memento = MementoHandler() | 168 | self.memento = MementoHandler() |
23 | 166 | self.memento.setLevel(logging.DEBUG) | 169 | self.memento.setLevel(logging.DEBUG) |
24 | 167 | gui.logger.addHandler(self.memento) | 170 | gui.logger.addHandler(self.memento) |
25 | 168 | 171 | ||
26 | 169 | def tearDown(self): | ||
27 | 170 | """Clean up.""" | ||
28 | 171 | self._called = False | ||
29 | 172 | |||
30 | 173 | def _set_called(self, *args, **kwargs): | 172 | def _set_called(self, *args, **kwargs): |
31 | 174 | """Set _called to True.""" | 173 | """Set _called to True.""" |
32 | 175 | self._called = (args, kwargs) | 174 | self._called = (args, kwargs) |
33 | @@ -178,9 +177,10 @@ | |||
34 | 178 | class LabeledEntryTestCase(BasicTestCase): | 177 | class LabeledEntryTestCase(BasicTestCase): |
35 | 179 | """Test suite for the labeled entry.""" | 178 | """Test suite for the labeled entry.""" |
36 | 180 | 179 | ||
37 | 180 | @defer.inlineCallbacks | ||
38 | 181 | def setUp(self): | 181 | def setUp(self): |
39 | 182 | """Init.""" | 182 | """Init.""" |
41 | 183 | super(LabeledEntryTestCase, self).setUp() | 183 | yield super(LabeledEntryTestCase, self).setUp() |
42 | 184 | self.label = 'Test me please' | 184 | self.label = 'Test me please' |
43 | 185 | self.entry = gui.LabeledEntry(label=self.label) | 185 | self.entry = gui.LabeledEntry(label=self.label) |
44 | 186 | 186 | ||
45 | @@ -189,11 +189,6 @@ | |||
46 | 189 | window.add(self.entry) | 189 | window.add(self.entry) |
47 | 190 | window.show_all() | 190 | window.show_all() |
48 | 191 | 191 | ||
49 | 192 | def tearDown(self): | ||
50 | 193 | """Clean up.""" | ||
51 | 194 | self.entry = None | ||
52 | 195 | super(LabeledEntryTestCase, self).tearDown() | ||
53 | 196 | |||
54 | 197 | def grab_focus(self, focus_in=True): | 192 | def grab_focus(self, focus_in=True): |
55 | 198 | """Grab focus on widget, if None use self.entry.""" | 193 | """Grab focus on widget, if None use self.entry.""" |
56 | 199 | direction = 'in' if focus_in else 'out' | 194 | direction = 'in' if focus_in else 'out' |
57 | @@ -352,9 +347,10 @@ | |||
58 | 352 | class PasswordLabeledEntryTestCase(LabeledEntryTestCase): | 347 | class PasswordLabeledEntryTestCase(LabeledEntryTestCase): |
59 | 353 | """Test suite for the labeled entry when is_password is True.""" | 348 | """Test suite for the labeled entry when is_password is True.""" |
60 | 354 | 349 | ||
61 | 350 | @defer.inlineCallbacks | ||
62 | 355 | def setUp(self): | 351 | def setUp(self): |
63 | 356 | """Init.""" | 352 | """Init.""" |
65 | 357 | super(PasswordLabeledEntryTestCase, self).setUp() | 353 | yield super(PasswordLabeledEntryTestCase, self).setUp() |
66 | 358 | self.entry.is_password = True | 354 | self.entry.is_password = True |
67 | 359 | 355 | ||
68 | 360 | def test_password_fields_are_visible_at_startup(self): | 356 | def test_password_fields_are_visible_at_startup(self): |
69 | @@ -382,9 +378,10 @@ | |||
70 | 382 | gui_class = gui.UbuntuSSOClientGUI | 378 | gui_class = gui.UbuntuSSOClientGUI |
71 | 383 | kwargs = dict(app_name=APP_NAME, tc_url=TC_URL, help_text=HELP_TEXT) | 379 | kwargs = dict(app_name=APP_NAME, tc_url=TC_URL, help_text=HELP_TEXT) |
72 | 384 | 380 | ||
73 | 381 | @defer.inlineCallbacks | ||
74 | 385 | def setUp(self): | 382 | def setUp(self): |
75 | 386 | """Init.""" | 383 | """Init.""" |
77 | 387 | super(UbuntuSSOClientTestCase, self).setUp() | 384 | yield super(UbuntuSSOClientTestCase, self).setUp() |
78 | 388 | self.patch(dbus, 'SessionBus', FakedSessionBus) | 385 | self.patch(dbus, 'SessionBus', FakedSessionBus) |
79 | 389 | self.patch(dbus, 'Interface', FakedSSOBackend) | 386 | self.patch(dbus, 'Interface', FakedSSOBackend) |
80 | 390 | self.pages = ('enter_details', 'processing', 'verify_email', 'finish', | 387 | self.pages = ('enter_details', 'processing', 'verify_email', 'finish', |
81 | @@ -393,11 +390,11 @@ | |||
82 | 393 | self.ui = self.gui_class(**self.kwargs) | 390 | self.ui = self.gui_class(**self.kwargs) |
83 | 394 | self.error = {'message': UNKNOWN_ERROR} | 391 | self.error = {'message': UNKNOWN_ERROR} |
84 | 395 | 392 | ||
85 | 393 | @defer.inlineCallbacks | ||
86 | 396 | def tearDown(self): | 394 | def tearDown(self): |
87 | 397 | """Clean up.""" | ||
88 | 398 | self.ui.bus.callbacks = {} | 395 | self.ui.bus.callbacks = {} |
89 | 399 | self.ui = None | 396 | self.ui = None |
91 | 400 | super(UbuntuSSOClientTestCase, self).tearDown() | 397 | yield super(UbuntuSSOClientTestCase, self).tearDown() |
92 | 401 | 398 | ||
93 | 402 | def assert_entries_are_packed_to_ui(self, container_name, entries): | 399 | def assert_entries_are_packed_to_ui(self, container_name, entries): |
94 | 403 | """Every entry is properly packed in the ui 'container_name'.""" | 400 | """Every entry is properly packed in the ui 'container_name'.""" |
95 | @@ -917,8 +914,9 @@ | |||
96 | 917 | class TermsAndConditionsBrowserTestCase(UbuntuSSOClientTestCase): | 914 | class TermsAndConditionsBrowserTestCase(UbuntuSSOClientTestCase): |
97 | 918 | """Test suite for the terms & conditions browser.""" | 915 | """Test suite for the terms & conditions browser.""" |
98 | 919 | 916 | ||
99 | 917 | @defer.inlineCallbacks | ||
100 | 920 | def setUp(self): | 918 | def setUp(self): |
102 | 921 | super(TermsAndConditionsBrowserTestCase, self).setUp() | 919 | yield super(TermsAndConditionsBrowserTestCase, self).setUp() |
103 | 922 | self.patch(webkit, 'WebView', FakedEmbeddedBrowser) | 920 | self.patch(webkit, 'WebView', FakedEmbeddedBrowser) |
104 | 923 | 921 | ||
105 | 924 | self.ui.tc_button.clicked() | 922 | self.ui.tc_button.clicked() |
106 | @@ -926,9 +924,10 @@ | |||
107 | 926 | assert len(children) == 1 | 924 | assert len(children) == 1 |
108 | 927 | self.browser = children[0] | 925 | self.browser = children[0] |
109 | 928 | 926 | ||
110 | 927 | @defer.inlineCallbacks | ||
111 | 929 | def tearDown(self): | 928 | def tearDown(self): |
112 | 930 | self.ui.tc_browser_vbox.hide() | 929 | self.ui.tc_browser_vbox.hide() |
114 | 931 | super(TermsAndConditionsBrowserTestCase, self).tearDown() | 930 | yield super(TermsAndConditionsBrowserTestCase, self).tearDown() |
115 | 932 | 931 | ||
116 | 933 | def test_tc_browser_is_created_when_tc_page_is_shown(self): | 932 | def test_tc_browser_is_created_when_tc_page_is_shown(self): |
117 | 934 | """The browser is created when the TC button is clicked.""" | 933 | """The browser is created when the TC button is clicked.""" |
118 | @@ -1074,9 +1073,10 @@ | |||
119 | 1074 | class RegistrationErrorTestCase(UbuntuSSOClientTestCase): | 1073 | class RegistrationErrorTestCase(UbuntuSSOClientTestCase): |
120 | 1075 | """Test suite for the user registration error handling.""" | 1074 | """Test suite for the user registration error handling.""" |
121 | 1076 | 1075 | ||
122 | 1076 | @defer.inlineCallbacks | ||
123 | 1077 | def setUp(self): | 1077 | def setUp(self): |
124 | 1078 | """Init.""" | 1078 | """Init.""" |
126 | 1079 | super(RegistrationErrorTestCase, self).setUp() | 1079 | yield super(RegistrationErrorTestCase, self).setUp() |
127 | 1080 | self.click_join_with_valid_data() | 1080 | self.click_join_with_valid_data() |
128 | 1081 | 1081 | ||
129 | 1082 | def test_previous_page_is_shown(self): | 1082 | def test_previous_page_is_shown(self): |
130 | @@ -1121,9 +1121,10 @@ | |||
131 | 1121 | class VerifyEmailTestCase(UbuntuSSOClientTestCase): | 1121 | class VerifyEmailTestCase(UbuntuSSOClientTestCase): |
132 | 1122 | """Test suite for the user registration (verify email page).""" | 1122 | """Test suite for the user registration (verify email page).""" |
133 | 1123 | 1123 | ||
134 | 1124 | @defer.inlineCallbacks | ||
135 | 1124 | def setUp(self): | 1125 | def setUp(self): |
136 | 1125 | """Init.""" | 1126 | """Init.""" |
138 | 1126 | super(VerifyEmailTestCase, self).setUp() | 1127 | yield super(VerifyEmailTestCase, self).setUp() |
139 | 1127 | self.ui.on_user_registered(app_name=APP_NAME, email=EMAIL) | 1128 | self.ui.on_user_registered(app_name=APP_NAME, email=EMAIL) |
140 | 1128 | self.click_verify_email_with_valid_data() | 1129 | self.click_verify_email_with_valid_data() |
141 | 1129 | 1130 | ||
142 | @@ -1265,9 +1266,10 @@ | |||
143 | 1265 | class VerifyEmailValidationTestCase(UbuntuSSOClientTestCase): | 1266 | class VerifyEmailValidationTestCase(UbuntuSSOClientTestCase): |
144 | 1266 | """Test suite for the user registration validation (verify email page).""" | 1267 | """Test suite for the user registration validation (verify email page).""" |
145 | 1267 | 1268 | ||
146 | 1269 | @defer.inlineCallbacks | ||
147 | 1268 | def setUp(self): | 1270 | def setUp(self): |
148 | 1269 | """Init.""" | 1271 | """Init.""" |
150 | 1270 | super(VerifyEmailValidationTestCase, self).setUp() | 1272 | yield super(VerifyEmailValidationTestCase, self).setUp() |
151 | 1271 | self.ui.on_user_registered(app_name=APP_NAME, email=EMAIL) | 1273 | self.ui.on_user_registered(app_name=APP_NAME, email=EMAIL) |
152 | 1272 | 1274 | ||
153 | 1273 | def test_warning_is_shown_if_empty_email_token(self): | 1275 | def test_warning_is_shown_if_empty_email_token(self): |
154 | @@ -1315,9 +1317,10 @@ | |||
155 | 1315 | class RegistrationValidationTestCase(UbuntuSSOClientTestCase): | 1317 | class RegistrationValidationTestCase(UbuntuSSOClientTestCase): |
156 | 1316 | """Test suite for the user registration validations.""" | 1318 | """Test suite for the user registration validations.""" |
157 | 1317 | 1319 | ||
158 | 1320 | @defer.inlineCallbacks | ||
159 | 1318 | def setUp(self): | 1321 | def setUp(self): |
160 | 1319 | """Init.""" | 1322 | """Init.""" |
162 | 1320 | super(RegistrationValidationTestCase, self).setUp() | 1323 | yield super(RegistrationValidationTestCase, self).setUp() |
163 | 1321 | self.ui.join_ok_button.set_sensitive(True) | 1324 | self.ui.join_ok_button.set_sensitive(True) |
164 | 1322 | 1325 | ||
165 | 1323 | def test_warning_is_shown_if_name_empty(self): | 1326 | def test_warning_is_shown_if_name_empty(self): |
166 | @@ -1448,9 +1451,10 @@ | |||
167 | 1448 | class LoginTestCase(UbuntuSSOClientTestCase): | 1451 | class LoginTestCase(UbuntuSSOClientTestCase): |
168 | 1449 | """Test suite for the user login pages.""" | 1452 | """Test suite for the user login pages.""" |
169 | 1450 | 1453 | ||
170 | 1454 | @defer.inlineCallbacks | ||
171 | 1451 | def setUp(self): | 1455 | def setUp(self): |
172 | 1452 | """Init.""" | 1456 | """Init.""" |
174 | 1453 | super(LoginTestCase, self).setUp() | 1457 | yield super(LoginTestCase, self).setUp() |
175 | 1454 | self.ui.login_button.clicked() | 1458 | self.ui.login_button.clicked() |
176 | 1455 | 1459 | ||
177 | 1456 | def test_login_button_clicked_morphs_to_login_page(self): | 1460 | def test_login_button_clicked_morphs_to_login_page(self): |
178 | @@ -1600,9 +1604,10 @@ | |||
179 | 1600 | class LoginValidationTestCase(UbuntuSSOClientTestCase): | 1604 | class LoginValidationTestCase(UbuntuSSOClientTestCase): |
180 | 1601 | """Test suite for the user login validation.""" | 1605 | """Test suite for the user login validation.""" |
181 | 1602 | 1606 | ||
182 | 1607 | @defer.inlineCallbacks | ||
183 | 1603 | def setUp(self): | 1608 | def setUp(self): |
184 | 1604 | """Init.""" | 1609 | """Init.""" |
186 | 1605 | super(LoginValidationTestCase, self).setUp() | 1610 | yield super(LoginValidationTestCase, self).setUp() |
187 | 1606 | self.ui.login_button.clicked() | 1611 | self.ui.login_button.clicked() |
188 | 1607 | 1612 | ||
189 | 1608 | def test_warning_is_shown_if_empty_email(self): | 1613 | def test_warning_is_shown_if_empty_email(self): |
190 | @@ -1656,9 +1661,10 @@ | |||
191 | 1656 | class ResetPasswordTestCase(UbuntuSSOClientTestCase): | 1661 | class ResetPasswordTestCase(UbuntuSSOClientTestCase): |
192 | 1657 | """Test suite for the reset password functionality.""" | 1662 | """Test suite for the reset password functionality.""" |
193 | 1658 | 1663 | ||
194 | 1664 | @defer.inlineCallbacks | ||
195 | 1659 | def setUp(self): | 1665 | def setUp(self): |
196 | 1660 | """Init.""" | 1666 | """Init.""" |
198 | 1661 | super(ResetPasswordTestCase, self).setUp() | 1667 | yield super(ResetPasswordTestCase, self).setUp() |
199 | 1662 | self.ui.login_button.clicked() | 1668 | self.ui.login_button.clicked() |
200 | 1663 | self.ui.forgotten_password_button.clicked() | 1669 | self.ui.forgotten_password_button.clicked() |
201 | 1664 | 1670 | ||
202 | @@ -1820,9 +1826,10 @@ | |||
203 | 1820 | class SetNewPasswordTestCase(UbuntuSSOClientTestCase): | 1826 | class SetNewPasswordTestCase(UbuntuSSOClientTestCase): |
204 | 1821 | """Test suite for setting a new password functionality.""" | 1827 | """Test suite for setting a new password functionality.""" |
205 | 1822 | 1828 | ||
206 | 1829 | @defer.inlineCallbacks | ||
207 | 1823 | def setUp(self): | 1830 | def setUp(self): |
208 | 1824 | """Init.""" | 1831 | """Init.""" |
210 | 1825 | super(SetNewPasswordTestCase, self).setUp() | 1832 | yield super(SetNewPasswordTestCase, self).setUp() |
211 | 1826 | self.click_request_password_token_with_valid_data() | 1833 | self.click_request_password_token_with_valid_data() |
212 | 1827 | self.ui.on_password_reset_token_sent(app_name=APP_NAME, email=EMAIL) | 1834 | self.ui.on_password_reset_token_sent(app_name=APP_NAME, email=EMAIL) |
213 | 1828 | 1835 | ||
214 | @@ -2122,9 +2129,10 @@ | |||
215 | 2122 | REGISTRATION_SUCCESS = 'registration_success_callback' | 2129 | REGISTRATION_SUCCESS = 'registration_success_callback' |
216 | 2123 | USER_CANCELLATION = 'user_cancellation_callback' | 2130 | USER_CANCELLATION = 'user_cancellation_callback' |
217 | 2124 | 2131 | ||
218 | 2132 | @defer.inlineCallbacks | ||
219 | 2125 | def setUp(self): | 2133 | def setUp(self): |
220 | 2126 | """Init.""" | 2134 | """Init.""" |
222 | 2127 | super(CallbacksTestCase, self).setUp() | 2135 | yield super(CallbacksTestCase, self).setUp() |
223 | 2128 | self._called = {} | 2136 | self._called = {} |
224 | 2129 | for name in (self.LOGIN_SUCCESSFULL, | 2137 | for name in (self.LOGIN_SUCCESSFULL, |
225 | 2130 | self.REGISTRATION_SUCCESS, | 2138 | self.REGISTRATION_SUCCESS, |
226 | @@ -2258,9 +2266,10 @@ | |||
227 | 2258 | class DefaultButtonsTestCase(UbuntuSSOClientTestCase): | 2266 | class DefaultButtonsTestCase(UbuntuSSOClientTestCase): |
228 | 2259 | """Each UI page has a default button when visible.""" | 2267 | """Each UI page has a default button when visible.""" |
229 | 2260 | 2268 | ||
230 | 2269 | @defer.inlineCallbacks | ||
231 | 2261 | def setUp(self): | 2270 | def setUp(self): |
232 | 2262 | """Init.""" | 2271 | """Init.""" |
234 | 2263 | super(DefaultButtonsTestCase, self).setUp() | 2272 | yield super(DefaultButtonsTestCase, self).setUp() |
235 | 2264 | self.mapping = ( | 2273 | self.mapping = ( |
236 | 2265 | ('enter_details_vbox', 'join_ok_button'), | 2274 | ('enter_details_vbox', 'join_ok_button'), |
237 | 2266 | ('tc_browser_vbox', 'tc_back_button'), | 2275 | ('tc_browser_vbox', 'tc_back_button'), |
238 | 2267 | 2276 | ||
239 | === modified file 'ubuntu_sso/keyring/tests/test_linux.py' | |||
240 | --- ubuntu_sso/keyring/tests/test_linux.py 2011-10-17 18:24:55 +0000 | |||
241 | +++ ubuntu_sso/keyring/tests/test_linux.py 2011-11-02 16:59:23 +0000 | |||
242 | @@ -114,8 +114,10 @@ | |||
243 | 114 | 114 | ||
244 | 115 | timeout = 5 | 115 | timeout = 5 |
245 | 116 | 116 | ||
246 | 117 | @defer.inlineCallbacks | ||
247 | 117 | def setUp(self): | 118 | def setUp(self): |
248 | 118 | """Initialize the mock used in these tests.""" | 119 | """Initialize the mock used in these tests.""" |
249 | 120 | yield super(TestKeyring, self).setUp() | ||
250 | 119 | self.mock_service = None | 121 | self.mock_service = None |
251 | 120 | self.service = self.patch(keyring, "SecretService", | 122 | self.service = self.patch(keyring, "SecretService", |
252 | 121 | self.get_mock_service) | 123 | self.get_mock_service) |
253 | 122 | 124 | ||
254 | === modified file 'ubuntu_sso/keyring/tests/test_windows.py' | |||
255 | --- ubuntu_sso/keyring/tests/test_windows.py 2011-10-13 12:03:04 +0000 | |||
256 | +++ ubuntu_sso/keyring/tests/test_windows.py 2011-11-02 16:59:23 +0000 | |||
257 | @@ -18,6 +18,7 @@ | |||
258 | 18 | 18 | ||
259 | 19 | from json import dumps | 19 | from json import dumps |
260 | 20 | 20 | ||
261 | 21 | from twisted.internet import defer | ||
262 | 21 | from twisted.trial.unittest import TestCase | 22 | from twisted.trial.unittest import TestCase |
263 | 22 | 23 | ||
264 | 23 | from ubuntu_sso.keyring import windows | 24 | from ubuntu_sso.keyring import windows |
265 | @@ -60,9 +61,10 @@ | |||
266 | 60 | class TestWindowsKeyring(TestCase): | 61 | class TestWindowsKeyring(TestCase): |
267 | 61 | """Test the windows keyring implementation.""" | 62 | """Test the windows keyring implementation.""" |
268 | 62 | 63 | ||
269 | 64 | @defer.inlineCallbacks | ||
270 | 63 | def setUp(self): | 65 | def setUp(self): |
271 | 64 | """Setup tests.""" | 66 | """Setup tests.""" |
273 | 65 | super(TestWindowsKeyring, self).setUp() | 67 | yield super(TestWindowsKeyring, self).setUp() |
274 | 66 | self.app_name = 'app_name' | 68 | self.app_name = 'app_name' |
275 | 67 | self.fake_keyring = FakePyKeyring() | 69 | self.fake_keyring = FakePyKeyring() |
276 | 68 | self.keyring = windows.Keyring(self.fake_keyring) | 70 | self.keyring = windows.Keyring(self.fake_keyring) |
277 | 69 | 71 | ||
278 | === modified file 'ubuntu_sso/main/tests/test_linux.py' | |||
279 | --- ubuntu_sso/main/tests/test_linux.py 2011-09-29 20:49:45 +0000 | |||
280 | +++ ubuntu_sso/main/tests/test_linux.py 2011-11-02 16:59:23 +0000 | |||
281 | @@ -24,7 +24,6 @@ | |||
282 | 24 | 24 | ||
283 | 25 | from mocker import Mocker, ARGS, KWARGS | 25 | from mocker import Mocker, ARGS, KWARGS |
284 | 26 | from twisted.internet import defer | 26 | from twisted.internet import defer |
285 | 27 | from twisted.trial.unittest import TestCase | ||
286 | 28 | from ubuntuone.devtools.handlers import MementoHandler | 27 | from ubuntuone.devtools.handlers import MementoHandler |
287 | 29 | 28 | ||
288 | 30 | import ubuntu_sso.keyring | 29 | import ubuntu_sso.keyring |
289 | @@ -75,8 +74,10 @@ | |||
290 | 75 | 74 | ||
291 | 76 | timeout = 2 | 75 | timeout = 2 |
292 | 77 | 76 | ||
293 | 77 | @defer.inlineCallbacks | ||
294 | 78 | def setUp(self): | 78 | def setUp(self): |
295 | 79 | """Create the mocking bus.""" | 79 | """Create the mocking bus.""" |
296 | 80 | yield super(SsoDbusTestCase, self).setUp() | ||
297 | 80 | self.mocker = Mocker() | 81 | self.mocker = Mocker() |
298 | 81 | self.mockbusname = self.mocker.mock() | 82 | self.mockbusname = self.mocker.mock() |
299 | 82 | mockbus = self.mocker.mock() | 83 | mockbus = self.mocker.mock() |
300 | @@ -97,10 +98,12 @@ | |||
301 | 97 | self.keyring_was_set = False | 98 | self.keyring_was_set = False |
302 | 98 | self.keyring_values = None | 99 | self.keyring_values = None |
303 | 99 | 100 | ||
304 | 101 | @defer.inlineCallbacks | ||
305 | 100 | def tearDown(self): | 102 | def tearDown(self): |
306 | 101 | """Verify the mocking bus and shut it down.""" | 103 | """Verify the mocking bus and shut it down.""" |
307 | 102 | self.mocker.verify() | 104 | self.mocker.verify() |
308 | 103 | self.mocker.restore() | 105 | self.mocker.restore() |
309 | 106 | yield super(SsoDbusTestCase, self).tearDown() | ||
310 | 104 | 107 | ||
311 | 105 | def test_creation(self): | 108 | def test_creation(self): |
312 | 106 | """Test that the object creation is successful.""" | 109 | """Test that the object creation is successful.""" |
313 | @@ -569,8 +572,9 @@ | |||
314 | 569 | UI_CLASS_KEY: 'SuperUI', UI_MODULE_KEY: 'foo.bar.baz', | 572 | UI_CLASS_KEY: 'SuperUI', UI_MODULE_KEY: 'foo.bar.baz', |
315 | 570 | } | 573 | } |
316 | 571 | 574 | ||
317 | 575 | @defer.inlineCallbacks | ||
318 | 572 | def setUp(self): | 576 | def setUp(self): |
320 | 573 | super(CredentialsManagementTestCase, self).setUp() | 577 | yield super(CredentialsManagementTestCase, self).setUp() |
321 | 574 | 578 | ||
322 | 575 | self.mocker = Mocker() | 579 | self.mocker = Mocker() |
323 | 576 | self.client = CredentialsManagement(timeout_func=lambda *a: None, | 580 | self.client = CredentialsManagement(timeout_func=lambda *a: None, |
324 | @@ -582,11 +586,12 @@ | |||
325 | 582 | self.memento.setLevel(logging.DEBUG) | 586 | self.memento.setLevel(logging.DEBUG) |
326 | 583 | ubuntu_sso.main.logger.addHandler(self.memento) | 587 | ubuntu_sso.main.logger.addHandler(self.memento) |
327 | 584 | 588 | ||
328 | 589 | @defer.inlineCallbacks | ||
329 | 585 | def tearDown(self): | 590 | def tearDown(self): |
330 | 586 | """Verify the mocking stuff and shut it down.""" | 591 | """Verify the mocking stuff and shut it down.""" |
331 | 587 | self.mocker.verify() | 592 | self.mocker.verify() |
332 | 588 | self.mocker.restore() | 593 | self.mocker.restore() |
334 | 589 | super(CredentialsManagementTestCase, self).tearDown() | 594 | yield super(CredentialsManagementTestCase, self).tearDown() |
335 | 590 | 595 | ||
336 | 591 | def assert_dbus_method_correct(self, method, out_signature=''): | 596 | def assert_dbus_method_correct(self, method, out_signature=''): |
337 | 592 | """Check that 'method' is a dbus method with proper signatures.""" | 597 | """Check that 'method' is a dbus method with proper signatures.""" |
338 | @@ -626,8 +631,9 @@ | |||
339 | 626 | class CredentialsManagementRefCountingTestCase(CredentialsManagementTestCase): | 631 | class CredentialsManagementRefCountingTestCase(CredentialsManagementTestCase): |
340 | 627 | """Tests for the CredentialsManagement ref counting.""" | 632 | """Tests for the CredentialsManagement ref counting.""" |
341 | 628 | 633 | ||
342 | 634 | @defer.inlineCallbacks | ||
343 | 629 | def setUp(self): | 635 | def setUp(self): |
345 | 630 | super(CredentialsManagementRefCountingTestCase, self).setUp() | 636 | yield super(CredentialsManagementRefCountingTestCase, self).setUp() |
346 | 631 | self.patch(ubuntu_sso.main, 'Credentials', FakeCredentials) | 637 | self.patch(ubuntu_sso.main, 'Credentials', FakeCredentials) |
347 | 632 | 638 | ||
348 | 633 | def test_ref_counting(self): | 639 | def test_ref_counting(self): |
349 | @@ -1140,8 +1146,9 @@ | |||
350 | 1140 | class CredentialsManagementOpsTestCase(CredentialsManagementTestCase): | 1146 | class CredentialsManagementOpsTestCase(CredentialsManagementTestCase): |
351 | 1141 | """Tests for the CredentialsManagement login/register methods.""" | 1147 | """Tests for the CredentialsManagement login/register methods.""" |
352 | 1142 | 1148 | ||
353 | 1149 | @defer.inlineCallbacks | ||
354 | 1143 | def setUp(self): | 1150 | def setUp(self): |
356 | 1144 | super(CredentialsManagementOpsTestCase, self).setUp() | 1151 | yield super(CredentialsManagementOpsTestCase, self).setUp() |
357 | 1145 | self.args = dict((k, str(v)) for k, v in self.base_args.iteritems()) | 1152 | self.args = dict((k, str(v)) for k, v in self.base_args.iteritems()) |
358 | 1146 | self.cred_args = self.base_args.copy() | 1153 | self.cred_args = self.base_args.copy() |
359 | 1147 | self.cred_args[SUCCESS_CB_KEY] = self.client.CredentialsFound | 1154 | self.cred_args[SUCCESS_CB_KEY] = self.client.CredentialsFound |
360 | @@ -1179,15 +1186,19 @@ | |||
361 | 1179 | class CredentialsManagementParamsTestCase(CredentialsManagementOpsTestCase): | 1186 | class CredentialsManagementParamsTestCase(CredentialsManagementOpsTestCase): |
362 | 1180 | """Tests for the CredentialsManagement extra parameters handling.""" | 1187 | """Tests for the CredentialsManagement extra parameters handling.""" |
363 | 1181 | 1188 | ||
364 | 1189 | @defer.inlineCallbacks | ||
365 | 1182 | def setUp(self): | 1190 | def setUp(self): |
367 | 1183 | super(CredentialsManagementParamsTestCase, self).setUp() | 1191 | yield super(CredentialsManagementParamsTestCase, self).setUp() |
368 | 1184 | self.args['dummy'] = 'nothing useful' | 1192 | self.args['dummy'] = 'nothing useful' |
369 | 1185 | 1193 | ||
370 | 1186 | 1194 | ||
371 | 1187 | class CredentialsManagementSignalsTestCase(TestCase): | 1195 | class CredentialsManagementSignalsTestCase(TestCase): |
372 | 1188 | """Tests for the CredentialsManagement DBus signals.""" | 1196 | """Tests for the CredentialsManagement DBus signals.""" |
373 | 1189 | 1197 | ||
374 | 1198 | @defer.inlineCallbacks | ||
375 | 1190 | def setUp(self): | 1199 | def setUp(self): |
376 | 1200 | """Set up.""" | ||
377 | 1201 | yield super(CredentialsManagementSignalsTestCase, self).setUp() | ||
378 | 1191 | self.client = CredentialsManagement(timeout_func=lambda *a: None, | 1202 | self.client = CredentialsManagement(timeout_func=lambda *a: None, |
379 | 1192 | shutdown_func=lambda *a: None) | 1203 | shutdown_func=lambda *a: None) |
380 | 1193 | 1204 | ||
381 | 1194 | 1205 | ||
382 | === modified file 'ubuntu_sso/main/tests/test_windows.py' | |||
383 | --- ubuntu_sso/main/tests/test_windows.py 2011-09-27 14:06:12 +0000 | |||
384 | +++ ubuntu_sso/main/tests/test_windows.py 2011-11-02 16:59:23 +0000 | |||
385 | @@ -96,9 +96,9 @@ | |||
386 | 96 | class SignalTestCase(MockerTestCase): | 96 | class SignalTestCase(MockerTestCase): |
387 | 97 | """Test the signal decorator.""" | 97 | """Test the signal decorator.""" |
388 | 98 | 98 | ||
389 | 99 | @defer.inlineCallbacks | ||
390 | 99 | def setUp(self): | 100 | def setUp(self): |
393 | 100 | """Set the tests.""" | 101 | yield super(SignalTestCase, self).setUp() |
392 | 101 | super(SignalTestCase, self).setUp() | ||
394 | 102 | self.fake_object = FakeDecoratedObject() | 102 | self.fake_object = FakeDecoratedObject() |
395 | 103 | self.cb = self.mocker.mock() | 103 | self.cb = self.mocker.mock() |
396 | 104 | 104 | ||
397 | @@ -275,15 +275,16 @@ | |||
398 | 275 | self.client_factory = PBClientFactory() | 275 | self.client_factory = PBClientFactory() |
399 | 276 | self.connector = reactor.connectTCP(LOCALHOST, port, | 276 | self.connector = reactor.connectTCP(LOCALHOST, port, |
400 | 277 | self.client_factory) | 277 | self.client_factory) |
401 | 278 | |||
402 | 279 | self.client = yield self._get_client() | 278 | self.client = yield self._get_client() |
403 | 280 | # pylint: enable=E1101 | 279 | # pylint: enable=E1101 |
404 | 281 | 280 | ||
405 | 281 | @defer.inlineCallbacks | ||
406 | 282 | def tearDown(self): | 282 | def tearDown(self): |
407 | 283 | """Clean reactor.""" | 283 | """Clean reactor.""" |
408 | 284 | yield super(SSOLoginTestCase, self).tearDown() | ||
409 | 284 | if self.server_factory.protocolInstance is not None: | 285 | if self.server_factory.protocolInstance is not None: |
410 | 285 | self.server_factory.protocolInstance.transport.loseConnection() | 286 | self.server_factory.protocolInstance.transport.loseConnection() |
412 | 286 | return defer.gatherResults([self._tearDownServer(), | 287 | yield defer.gatherResults([self._tearDownServer(), |
413 | 287 | self._tearDownClient()]) | 288 | self._tearDownClient()]) |
414 | 288 | 289 | ||
415 | 289 | def _tearDownServer(self): | 290 | def _tearDownServer(self): |
416 | @@ -565,11 +566,13 @@ | |||
417 | 565 | self.client = yield self._get_client() | 566 | self.client = yield self._get_client() |
418 | 566 | # pylint: enable=E1101 | 567 | # pylint: enable=E1101 |
419 | 567 | 568 | ||
420 | 569 | @defer.inlineCallbacks | ||
421 | 568 | def tearDown(self): | 570 | def tearDown(self): |
422 | 569 | """Clean reactor.""" | 571 | """Clean reactor.""" |
423 | 572 | yield super(CredentialsManagementTestCase, self).tearDown() | ||
424 | 570 | if self.server_factory.protocolInstance is not None: | 573 | if self.server_factory.protocolInstance is not None: |
425 | 571 | self.server_factory.protocolInstance.transport.loseConnection() | 574 | self.server_factory.protocolInstance.transport.loseConnection() |
427 | 572 | return defer.gatherResults([self._tearDownServer(), | 575 | yield defer.gatherResults([self._tearDownServer(), |
428 | 573 | self._tearDownClient()]) | 576 | self._tearDownClient()]) |
429 | 574 | 577 | ||
430 | 575 | def _tearDownServer(self): | 578 | def _tearDownServer(self): |
431 | @@ -854,7 +857,9 @@ | |||
432 | 854 | 857 | ||
433 | 855 | # pylint: disable=W0212 | 858 | # pylint: disable=W0212 |
434 | 856 | 859 | ||
435 | 860 | @defer.inlineCallbacks | ||
436 | 857 | def setUp(self): | 861 | def setUp(self): |
437 | 862 | yield super(UbuntuSSOClientTestCase, self).setUp() | ||
438 | 858 | self.mac = MockActivationClient() | 863 | self.mac = MockActivationClient() |
439 | 859 | self.patch(windows, "reactor", MockReactor()) | 864 | self.patch(windows, "reactor", MockReactor()) |
440 | 860 | self.patch(windows, "PBClientFactory", MockPBClientFactory) | 865 | self.patch(windows, "PBClientFactory", MockPBClientFactory) |
441 | 861 | 866 | ||
442 | === modified file 'ubuntu_sso/qt/tests/test_common.py' | |||
443 | --- ubuntu_sso/qt/tests/test_common.py 2011-09-01 17:05:11 +0000 | |||
444 | +++ ubuntu_sso/qt/tests/test_common.py 2011-11-02 16:59:23 +0000 | |||
445 | @@ -17,6 +17,7 @@ | |||
446 | 17 | """Test the common functions.""" | 17 | """Test the common functions.""" |
447 | 18 | 18 | ||
448 | 19 | from PyQt4 import QtGui | 19 | from PyQt4 import QtGui |
449 | 20 | from twisted.internet import defer | ||
450 | 20 | from twisted.trial.unittest import TestCase | 21 | from twisted.trial.unittest import TestCase |
451 | 21 | 22 | ||
452 | 22 | from ubuntu_sso.qt.common import (check_as_invalid, | 23 | from ubuntu_sso.qt.common import (check_as_invalid, |
453 | @@ -35,9 +36,10 @@ | |||
454 | 35 | class PasswordTestCase(TestCase): | 36 | class PasswordTestCase(TestCase): |
455 | 36 | """Test passwords conditions.""" | 37 | """Test passwords conditions.""" |
456 | 37 | 38 | ||
457 | 39 | @defer.inlineCallbacks | ||
458 | 38 | def setUp(self): | 40 | def setUp(self): |
459 | 39 | """Setup tests.""" | 41 | """Setup tests.""" |
461 | 40 | super(PasswordTestCase, self).setUp() | 42 | yield super(PasswordTestCase, self).setUp() |
462 | 41 | self.line_edit = QtGui.QLineEdit() | 43 | self.line_edit = QtGui.QLineEdit() |
463 | 42 | self.line_edit_confirm = QtGui.QLineEdit() | 44 | self.line_edit_confirm = QtGui.QLineEdit() |
464 | 43 | self.label_assistance = QtGui.QLabel() | 45 | self.label_assistance = QtGui.QLabel() |
465 | 44 | 46 | ||
466 | === modified file 'ubuntu_sso/qt/tests/test_controllers.py' | |||
467 | --- ubuntu_sso/qt/tests/test_controllers.py 2011-10-07 12:31:54 +0000 | |||
468 | +++ ubuntu_sso/qt/tests/test_controllers.py 2011-11-02 16:59:23 +0000 | |||
469 | @@ -711,9 +711,10 @@ | |||
470 | 711 | class ChooseSignInControllerTestCase(BaseTestCase): | 711 | class ChooseSignInControllerTestCase(BaseTestCase): |
471 | 712 | """Test the choose sign in controller.""" | 712 | """Test the choose sign in controller.""" |
472 | 713 | 713 | ||
473 | 714 | @defer.inlineCallbacks | ||
474 | 714 | def setUp(self): | 715 | def setUp(self): |
475 | 715 | """Set tests.""" | 716 | """Set tests.""" |
477 | 716 | super(ChooseSignInControllerTestCase, self).setUp() | 717 | yield super(ChooseSignInControllerTestCase, self).setUp() |
478 | 717 | self.title = 'title' | 718 | self.title = 'title' |
479 | 718 | self.subtitle = 'subtitle' | 719 | self.subtitle = 'subtitle' |
480 | 719 | self.controller = ChooseSignInController(self.title, self.subtitle) | 720 | self.controller = ChooseSignInController(self.title, self.subtitle) |
481 | @@ -768,9 +769,10 @@ | |||
482 | 768 | class CurrentUserControllerTestCase(BaseTestCase): | 769 | class CurrentUserControllerTestCase(BaseTestCase): |
483 | 769 | """Test the current user controller.""" | 770 | """Test the current user controller.""" |
484 | 770 | 771 | ||
485 | 772 | @defer.inlineCallbacks | ||
486 | 771 | def setUp(self): | 773 | def setUp(self): |
487 | 772 | """Setup tests.""" | 774 | """Setup tests.""" |
489 | 773 | super(CurrentUserControllerTestCase, self).setUp() | 775 | yield super(CurrentUserControllerTestCase, self).setUp() |
490 | 774 | self.controller = CurrentUserController(title='the title', | 776 | self.controller = CurrentUserController(title='the title', |
491 | 775 | subtitle='the subtitle') | 777 | subtitle='the subtitle') |
492 | 776 | self.view = FakeCurrentUserView() | 778 | self.view = FakeCurrentUserView() |
493 | @@ -867,9 +869,10 @@ | |||
494 | 867 | on_error_method_name = "on_login_error" | 869 | on_error_method_name = "on_login_error" |
495 | 868 | controller_class = CurrentUserController | 870 | controller_class = CurrentUserController |
496 | 869 | 871 | ||
497 | 872 | @defer.inlineCallbacks | ||
498 | 870 | def setUp(self): | 873 | def setUp(self): |
499 | 871 | """Setup test.""" | 874 | """Setup test.""" |
501 | 872 | super(CurrentUserControllerErrorTestCase, self).setUp() | 875 | yield super(CurrentUserControllerErrorTestCase, self).setUp() |
502 | 873 | self.message_box = FakeMessageBox() | 876 | self.message_box = FakeMessageBox() |
503 | 874 | self.controller = self.controller_class( | 877 | self.controller = self.controller_class( |
504 | 875 | message_box=self.message_box) | 878 | message_box=self.message_box) |
505 | @@ -928,9 +931,10 @@ | |||
506 | 928 | on_error_method_name = "on_email_validation_error" | 931 | on_error_method_name = "on_email_validation_error" |
507 | 929 | controller_class = EmailVerificationController | 932 | controller_class = EmailVerificationController |
508 | 930 | 933 | ||
509 | 934 | @defer.inlineCallbacks | ||
510 | 931 | def setUp(self): | 935 | def setUp(self): |
511 | 932 | """Setup test.""" | 936 | """Setup test.""" |
513 | 933 | super(EmailVerificationControllerErrorTestCase, self).setUp() | 937 | yield super(EmailVerificationControllerErrorTestCase, self).setUp() |
514 | 934 | # This error handler takes one extra argument. | 938 | # This error handler takes one extra argument. |
515 | 935 | self.on_error_method = lambda error: getattr( | 939 | self.on_error_method = lambda error: getattr( |
516 | 936 | self.controller, self.on_error_method_name)('APP', error) | 940 | self.controller, self.on_error_method_name)('APP', error) |
517 | @@ -944,9 +948,10 @@ | |||
518 | 944 | on_error_method_name = "on_user_registration_error" | 948 | on_error_method_name = "on_user_registration_error" |
519 | 945 | controller_class = SetUpAccountController | 949 | controller_class = SetUpAccountController |
520 | 946 | 950 | ||
521 | 951 | @defer.inlineCallbacks | ||
522 | 947 | def setUp(self): | 952 | def setUp(self): |
523 | 948 | """Setup test.""" | 953 | """Setup test.""" |
525 | 949 | super(SetUpAccountControllerErrorTestCase, self).setUp() | 954 | yield super(SetUpAccountControllerErrorTestCase, self).setUp() |
526 | 950 | self.patch(self.controller, "_refresh_captcha", lambda *args: None) | 955 | self.patch(self.controller, "_refresh_captcha", lambda *args: None) |
527 | 951 | 956 | ||
528 | 952 | 957 | ||
529 | @@ -963,9 +968,10 @@ | |||
530 | 963 | 968 | ||
531 | 964 | """Tests for CurrentUserController, but without Mocker.""" | 969 | """Tests for CurrentUserController, but without Mocker.""" |
532 | 965 | 970 | ||
533 | 971 | @defer.inlineCallbacks | ||
534 | 966 | def setUp(self): | 972 | def setUp(self): |
535 | 967 | """Setup test.""" | 973 | """Setup test.""" |
537 | 968 | super(CurrentUserControllerValidationTest, self).setUp() | 974 | yield super(CurrentUserControllerValidationTest, self).setUp() |
538 | 969 | self.message_box = FakeMessageBox() | 975 | self.message_box = FakeMessageBox() |
539 | 970 | self.controller = CurrentUserController( | 976 | self.controller = CurrentUserController( |
540 | 971 | message_box=self.message_box) | 977 | message_box=self.message_box) |
541 | @@ -1023,9 +1029,10 @@ | |||
542 | 1023 | class SetUpAccountControllerTestCase(BaseTestCase): | 1029 | class SetUpAccountControllerTestCase(BaseTestCase): |
543 | 1024 | """test the controller used to setup a new account.""" | 1030 | """test the controller used to setup a new account.""" |
544 | 1025 | 1031 | ||
545 | 1032 | @defer.inlineCallbacks | ||
546 | 1026 | def setUp(self): | 1033 | def setUp(self): |
547 | 1027 | """Set the different tests.""" | 1034 | """Set the different tests.""" |
549 | 1028 | super(SetUpAccountControllerTestCase, self).setUp() | 1035 | yield super(SetUpAccountControllerTestCase, self).setUp() |
550 | 1029 | self.view = FakeSetupAccountPageView() | 1036 | self.view = FakeSetupAccountPageView() |
551 | 1030 | self.message_box = FakeMessageBox() | 1037 | self.message_box = FakeMessageBox() |
552 | 1031 | self.controller = SetUpAccountController(message_box=self.message_box) | 1038 | self.controller = SetUpAccountController(message_box=self.message_box) |
553 | @@ -1432,9 +1439,10 @@ | |||
554 | 1432 | class SetupAccountControllerCaptchaTest(BaseTestCase): | 1439 | class SetupAccountControllerCaptchaTest(BaseTestCase): |
555 | 1433 | """Tests for SetupAccountController, but without Mocker.""" | 1440 | """Tests for SetupAccountController, but without Mocker.""" |
556 | 1434 | 1441 | ||
557 | 1442 | @defer.inlineCallbacks | ||
558 | 1435 | def setUp(self): | 1443 | def setUp(self): |
559 | 1436 | """Set the different tests.""" | 1444 | """Set the different tests.""" |
561 | 1437 | super(SetupAccountControllerCaptchaTest, self).setUp() | 1445 | yield super(SetupAccountControllerCaptchaTest, self).setUp() |
562 | 1438 | self.message_box = FakeMessageBox() | 1446 | self.message_box = FakeMessageBox() |
563 | 1439 | self.controller = SetUpAccountController(message_box=self.message_box) | 1447 | self.controller = SetUpAccountController(message_box=self.message_box) |
564 | 1440 | self.patch(self.controller, 'view', FakeSetupAccountView()) | 1448 | self.patch(self.controller, 'view', FakeSetupAccountView()) |
565 | @@ -1452,9 +1460,10 @@ | |||
566 | 1452 | class SetupAccountControllerValidationTest(BaseTestCase): | 1460 | class SetupAccountControllerValidationTest(BaseTestCase): |
567 | 1453 | """Tests for SetupAccountController, but without Mocker.""" | 1461 | """Tests for SetupAccountController, but without Mocker.""" |
568 | 1454 | 1462 | ||
569 | 1463 | @defer.inlineCallbacks | ||
570 | 1455 | def setUp(self): | 1464 | def setUp(self): |
571 | 1456 | """Set the different tests.""" | 1465 | """Set the different tests.""" |
573 | 1457 | super(SetupAccountControllerValidationTest, self).setUp() | 1466 | yield super(SetupAccountControllerValidationTest, self).setUp() |
574 | 1458 | self.message_box = FakeMessageBox() | 1467 | self.message_box = FakeMessageBox() |
575 | 1459 | self.controller = SetUpAccountController(message_box=self.message_box) | 1468 | self.controller = SetUpAccountController(message_box=self.message_box) |
576 | 1460 | self.patch(self.controller, '_refresh_captcha', self._set_called) | 1469 | self.patch(self.controller, '_refresh_captcha', self._set_called) |
577 | @@ -1509,9 +1518,10 @@ | |||
578 | 1509 | class EmailVerificationControllerTestCase(BaseTestCase): | 1518 | class EmailVerificationControllerTestCase(BaseTestCase): |
579 | 1510 | """Test the controller.""" | 1519 | """Test the controller.""" |
580 | 1511 | 1520 | ||
581 | 1521 | @defer.inlineCallbacks | ||
582 | 1512 | def setUp(self): | 1522 | def setUp(self): |
583 | 1513 | """Set tests.""" | 1523 | """Set tests.""" |
585 | 1514 | super(EmailVerificationControllerTestCase, self).setUp() | 1524 | yield super(EmailVerificationControllerTestCase, self).setUp() |
586 | 1515 | self.view = EmailVerificationView() | 1525 | self.view = EmailVerificationView() |
587 | 1516 | self.backend = self.view | 1526 | self.backend = self.view |
588 | 1517 | self.controller = EmailVerificationController( | 1527 | self.controller = EmailVerificationController( |
589 | @@ -1599,9 +1609,11 @@ | |||
590 | 1599 | class EmailVerificationControllerValidationTestCase(BaseTestCase): | 1609 | class EmailVerificationControllerValidationTestCase(BaseTestCase): |
591 | 1600 | """Tests for EmailVerificationController, but without Mocker.""" | 1610 | """Tests for EmailVerificationController, but without Mocker.""" |
592 | 1601 | 1611 | ||
593 | 1612 | @defer.inlineCallbacks | ||
594 | 1602 | def setUp(self): | 1613 | def setUp(self): |
595 | 1603 | """Set the different tests.""" | 1614 | """Set the different tests.""" |
597 | 1604 | super(EmailVerificationControllerValidationTestCase, self).setUp() | 1615 | yield super(EmailVerificationControllerValidationTestCase, |
598 | 1616 | self).setUp() | ||
599 | 1605 | self.message_box = FakeMessageBox() | 1617 | self.message_box = FakeMessageBox() |
600 | 1606 | self.controller = EmailVerificationController( | 1618 | self.controller = EmailVerificationController( |
601 | 1607 | message_box=self.message_box) | 1619 | message_box=self.message_box) |
602 | @@ -1642,9 +1654,9 @@ | |||
603 | 1642 | class ErrorControllerTestCase(BaseTestCase): | 1654 | class ErrorControllerTestCase(BaseTestCase): |
604 | 1643 | """Test the success page controller.""" | 1655 | """Test the success page controller.""" |
605 | 1644 | 1656 | ||
606 | 1657 | @defer.inlineCallbacks | ||
607 | 1645 | def setUp(self): | 1658 | def setUp(self): |
610 | 1646 | """Set the tests.""" | 1659 | yield super(ErrorControllerTestCase, self).setUp() |
609 | 1647 | super(ErrorControllerTestCase, self).setUp() | ||
611 | 1648 | self.view = ErrorPageView() | 1660 | self.view = ErrorPageView() |
612 | 1649 | self.backend = self.view | 1661 | self.backend = self.view |
613 | 1650 | self.controller = ErrorController() | 1662 | self.controller = ErrorController() |
614 | @@ -1665,9 +1677,9 @@ | |||
615 | 1665 | class SuccessControllerTestCase(BaseTestCase): | 1677 | class SuccessControllerTestCase(BaseTestCase): |
616 | 1666 | """Test the success page controller.""" | 1678 | """Test the success page controller.""" |
617 | 1667 | 1679 | ||
618 | 1680 | @defer.inlineCallbacks | ||
619 | 1668 | def setUp(self): | 1681 | def setUp(self): |
622 | 1669 | """Set the tests.""" | 1682 | yield super(SuccessControllerTestCase, self).setUp() |
621 | 1670 | super(SuccessControllerTestCase, self).setUp() | ||
623 | 1671 | self.view = SuccessPageView() | 1683 | self.view = SuccessPageView() |
624 | 1672 | self.backend = self.view | 1684 | self.backend = self.view |
625 | 1673 | self.controller = SuccessController() | 1685 | self.controller = SuccessController() |
626 | @@ -1688,9 +1700,10 @@ | |||
627 | 1688 | class UbuntuSSOWizardControllerTestCase(BaseTestCase): | 1700 | class UbuntuSSOWizardControllerTestCase(BaseTestCase): |
628 | 1689 | """Test the wizard controller.""" | 1701 | """Test the wizard controller.""" |
629 | 1690 | 1702 | ||
630 | 1703 | @defer.inlineCallbacks | ||
631 | 1691 | def setUp(self): | 1704 | def setUp(self): |
632 | 1692 | """Set tests.""" | 1705 | """Set tests.""" |
634 | 1693 | super(UbuntuSSOWizardControllerTestCase, self).setUp() | 1706 | yield super(UbuntuSSOWizardControllerTestCase, self).setUp() |
635 | 1694 | self.view = UbuntuSSOView() | 1707 | self.view = UbuntuSSOView() |
636 | 1695 | self.backend = self.view | 1708 | self.backend = self.view |
637 | 1696 | self.callback = self.view.callback | 1709 | self.callback = self.view.callback |
638 | @@ -1765,9 +1778,10 @@ | |||
639 | 1765 | 1778 | ||
640 | 1766 | """Tests for ForgottenPasswordController, but without Mocker.""" | 1779 | """Tests for ForgottenPasswordController, but without Mocker.""" |
641 | 1767 | 1780 | ||
642 | 1781 | @defer.inlineCallbacks | ||
643 | 1768 | def setUp(self): | 1782 | def setUp(self): |
644 | 1769 | """Set the different tests.""" | 1783 | """Set the different tests.""" |
646 | 1770 | super(ForgottenPasswordControllerValidationTest, self).setUp() | 1784 | yield super(ForgottenPasswordControllerValidationTest, self).setUp() |
647 | 1771 | self.message_box = FakeMessageBox() | 1785 | self.message_box = FakeMessageBox() |
648 | 1772 | self.controller = ForgottenPasswordController( | 1786 | self.controller = ForgottenPasswordController( |
649 | 1773 | message_box=self.message_box) | 1787 | message_box=self.message_box) |
650 | @@ -1857,9 +1871,10 @@ | |||
651 | 1857 | class ForgottenPasswordControllerTestCase(BaseTestCase): | 1871 | class ForgottenPasswordControllerTestCase(BaseTestCase): |
652 | 1858 | """Test the controller of the fogotten password page.""" | 1872 | """Test the controller of the fogotten password page.""" |
653 | 1859 | 1873 | ||
654 | 1874 | @defer.inlineCallbacks | ||
655 | 1860 | def setUp(self): | 1875 | def setUp(self): |
656 | 1861 | """Setup the tests.""" | 1876 | """Setup the tests.""" |
658 | 1862 | super(ForgottenPasswordControllerTestCase, self).setUp() | 1877 | yield super(ForgottenPasswordControllerTestCase, self).setUp() |
659 | 1863 | self.view = FakeForgottenPasswordPageView() | 1878 | self.view = FakeForgottenPasswordPageView() |
660 | 1864 | self.backend = self.view | 1879 | self.backend = self.view |
661 | 1865 | self.controller = ForgottenPasswordController( | 1880 | self.controller = ForgottenPasswordController( |
662 | @@ -1926,9 +1941,10 @@ | |||
663 | 1926 | class ResetPasswordControllerTestCase(BaseTestCase): | 1941 | class ResetPasswordControllerTestCase(BaseTestCase): |
664 | 1927 | """Ensure that the reset password works as expected.""" | 1942 | """Ensure that the reset password works as expected.""" |
665 | 1928 | 1943 | ||
666 | 1944 | @defer.inlineCallbacks | ||
667 | 1929 | def setUp(self): | 1945 | def setUp(self): |
668 | 1930 | """Setup the tests.""" | 1946 | """Setup the tests.""" |
670 | 1931 | super(ResetPasswordControllerTestCase, self).setUp() | 1947 | yield super(ResetPasswordControllerTestCase, self).setUp() |
671 | 1932 | self.view = ResetPasswordPageView() | 1948 | self.view = ResetPasswordPageView() |
672 | 1933 | self.backend = self.view | 1949 | self.backend = self.view |
673 | 1934 | self.controller = ResetPasswordController() | 1950 | self.controller = ResetPasswordController() |
674 | @@ -2001,9 +2017,10 @@ | |||
675 | 2001 | 2017 | ||
676 | 2002 | """Tests for ResetPasswordController, but without Mocker.""" | 2018 | """Tests for ResetPasswordController, but without Mocker.""" |
677 | 2003 | 2019 | ||
678 | 2020 | @defer.inlineCallbacks | ||
679 | 2004 | def setUp(self): | 2021 | def setUp(self): |
680 | 2005 | """Setup test.""" | 2022 | """Setup test.""" |
682 | 2006 | super(ResetPasswordControllerValidationTest, self).setUp() | 2023 | yield super(ResetPasswordControllerValidationTest, self).setUp() |
683 | 2007 | self.controller = ResetPasswordController() | 2024 | self.controller = ResetPasswordController() |
684 | 2008 | self.controller.view = FakeResetPasswordPage() | 2025 | self.controller.view = FakeResetPasswordPage() |
685 | 2009 | 2026 | ||
686 | @@ -2067,9 +2084,10 @@ | |||
687 | 2067 | 2084 | ||
688 | 2068 | """Tests for ResetPasswordController, but without Mocker.""" | 2085 | """Tests for ResetPasswordController, but without Mocker.""" |
689 | 2069 | 2086 | ||
690 | 2087 | @defer.inlineCallbacks | ||
691 | 2070 | def setUp(self): | 2088 | def setUp(self): |
692 | 2071 | """Setup test.""" | 2089 | """Setup test.""" |
694 | 2072 | super(ResetPasswordControllerRealControllerTest, self).setUp() | 2090 | yield super(ResetPasswordControllerRealControllerTest, self).setUp() |
695 | 2073 | self.controller = ResetPasswordController() | 2091 | self.controller = ResetPasswordController() |
696 | 2074 | self.controller.view = FakeWizardForResetPassword() | 2092 | self.controller.view = FakeWizardForResetPassword() |
697 | 2075 | 2093 | ||
698 | 2076 | 2094 | ||
699 | === modified file 'ubuntu_sso/qt/tests/test_reset_password.py' | |||
700 | --- ubuntu_sso/qt/tests/test_reset_password.py 2011-09-08 16:43:39 +0000 | |||
701 | +++ ubuntu_sso/qt/tests/test_reset_password.py 2011-11-02 16:59:23 +0000 | |||
702 | @@ -17,6 +17,7 @@ | |||
703 | 17 | """Test the Reset Password Page.""" | 17 | """Test the Reset Password Page.""" |
704 | 18 | 18 | ||
705 | 19 | from PyQt4 import QtGui, QtCore | 19 | from PyQt4 import QtGui, QtCore |
706 | 20 | from twisted.internet import defer | ||
707 | 20 | from twisted.trial.unittest import TestCase | 21 | from twisted.trial.unittest import TestCase |
708 | 21 | 22 | ||
709 | 22 | from ubuntu_sso.utils.ui import ( | 23 | from ubuntu_sso.utils.ui import ( |
710 | @@ -47,8 +48,9 @@ | |||
711 | 47 | class ResetPasswordTestCase(TestCase): | 48 | class ResetPasswordTestCase(TestCase): |
712 | 48 | """Test the ResetPasswordPage code.""" | 49 | """Test the ResetPasswordPage code.""" |
713 | 49 | 50 | ||
714 | 51 | @defer.inlineCallbacks | ||
715 | 50 | def setUp(self): | 52 | def setUp(self): |
717 | 51 | super(ResetPasswordTestCase, self).setUp() | 53 | yield super(ResetPasswordTestCase, self).setUp() |
718 | 52 | self.page = ResetPasswordPage(Ui_ResetPasswordPage(), | 54 | self.page = ResetPasswordPage(Ui_ResetPasswordPage(), |
719 | 53 | None, | 55 | None, |
720 | 54 | None) | 56 | None) |
721 | 55 | 57 | ||
722 | === modified file 'ubuntu_sso/tests/__init__.py' | |||
723 | --- ubuntu_sso/tests/__init__.py 2011-08-11 21:26:53 +0000 | |||
724 | +++ ubuntu_sso/tests/__init__.py 2011-11-02 16:59:23 +0000 | |||
725 | @@ -18,6 +18,7 @@ | |||
726 | 18 | 18 | ||
727 | 19 | import os | 19 | import os |
728 | 20 | 20 | ||
729 | 21 | from twisted.internet import defer | ||
730 | 21 | from twisted.trial import unittest | 22 | from twisted.trial import unittest |
731 | 22 | 23 | ||
732 | 23 | from ubuntu_sso.keyring import get_token_name | 24 | from ubuntu_sso.keyring import get_token_name |
733 | @@ -52,8 +53,9 @@ | |||
734 | 52 | class TestCase(unittest.TestCase): | 53 | class TestCase(unittest.TestCase): |
735 | 53 | """Customized test case that keeps tracks of method calls.""" | 54 | """Customized test case that keeps tracks of method calls.""" |
736 | 54 | 55 | ||
737 | 56 | @defer.inlineCallbacks | ||
738 | 55 | def setUp(self): | 57 | def setUp(self): |
740 | 56 | super(TestCase, self).setUp() | 58 | yield super(TestCase, self).setUp() |
741 | 57 | self._called = False | 59 | self._called = False |
742 | 58 | 60 | ||
743 | 59 | def _set_called(self, *args, **kwargs): | 61 | def _set_called(self, *args, **kwargs): |
744 | 60 | 62 | ||
745 | === modified file 'ubuntu_sso/tests/test_account.py' | |||
746 | --- ubuntu_sso/tests/test_account.py 2011-10-21 16:06:50 +0000 | |||
747 | +++ ubuntu_sso/tests/test_account.py 2011-11-02 16:59:23 +0000 | |||
748 | @@ -27,6 +27,7 @@ | |||
749 | 27 | # pylint: enable=F0401 | 27 | # pylint: enable=F0401 |
750 | 28 | from oauth import oauth | 28 | from oauth import oauth |
751 | 29 | from twisted.trial.unittest import TestCase | 29 | from twisted.trial.unittest import TestCase |
752 | 30 | from twisted.internet import defer | ||
753 | 30 | 31 | ||
754 | 31 | from ubuntu_sso.account import ( | 32 | from ubuntu_sso.account import ( |
755 | 32 | Account, | 33 | Account, |
756 | @@ -200,8 +201,10 @@ | |||
757 | 200 | class AccountTestCase(TestCase): | 201 | class AccountTestCase(TestCase): |
758 | 201 | """Test suite for the SSO login processor.""" | 202 | """Test suite for the SSO login processor.""" |
759 | 202 | 203 | ||
760 | 204 | @defer.inlineCallbacks | ||
761 | 203 | def setUp(self): | 205 | def setUp(self): |
763 | 204 | """Init.""" | 206 | """Set up.""" |
764 | 207 | yield super(AccountTestCase, self).setUp() | ||
765 | 205 | 208 | ||
766 | 206 | def fake_urlopen(url): | 209 | def fake_urlopen(url): |
767 | 207 | """Fake an urlopen which will read from the disk.""" | 210 | """Fake an urlopen which will read from the disk.""" |
768 | @@ -218,8 +221,10 @@ | |||
769 | 218 | self.login_kwargs = dict(email=EMAIL, password=PASSWORD, | 221 | self.login_kwargs = dict(email=EMAIL, password=PASSWORD, |
770 | 219 | token_name=TOKEN_NAME) | 222 | token_name=TOKEN_NAME) |
771 | 220 | 223 | ||
772 | 224 | @defer.inlineCallbacks | ||
773 | 221 | def tearDown(self): | 225 | def tearDown(self): |
775 | 222 | """Clean up.""" | 226 | """Tear down.""" |
776 | 227 | yield super(AccountTestCase, self).tearDown() | ||
777 | 223 | self.processor = None | 228 | self.processor = None |
778 | 224 | 229 | ||
779 | 225 | def test_generate_captcha(self): | 230 | def test_generate_captcha(self): |
780 | 226 | 231 | ||
781 | === modified file 'ubuntu_sso/tests/test_credentials.py' | |||
782 | --- ubuntu_sso/tests/test_credentials.py 2011-09-22 14:29:21 +0000 | |||
783 | +++ ubuntu_sso/tests/test_credentials.py 2011-11-02 16:59:23 +0000 | |||
784 | @@ -103,18 +103,16 @@ | |||
785 | 103 | class BasicTestCase(TestCase): | 103 | class BasicTestCase(TestCase): |
786 | 104 | """Test case with a helper tracker.""" | 104 | """Test case with a helper tracker.""" |
787 | 105 | 105 | ||
788 | 106 | @defer.inlineCallbacks | ||
789 | 106 | def setUp(self): | 107 | def setUp(self): |
790 | 107 | """Init.""" | 108 | """Init.""" |
791 | 109 | yield super(BasicTestCase, self).setUp() | ||
792 | 108 | self._called = False # helper | 110 | self._called = False # helper |
793 | 109 | 111 | ||
794 | 110 | self.memento = MementoHandler() | 112 | self.memento = MementoHandler() |
795 | 111 | self.memento.setLevel(logging.DEBUG) | 113 | self.memento.setLevel(logging.DEBUG) |
796 | 112 | credentials.logger.addHandler(self.memento) | 114 | credentials.logger.addHandler(self.memento) |
797 | 113 | 115 | ||
798 | 114 | def tearDown(self): | ||
799 | 115 | """Clean up.""" | ||
800 | 116 | self._called = False | ||
801 | 117 | |||
802 | 118 | def _set_called(self, *args, **kwargs): | 116 | def _set_called(self, *args, **kwargs): |
803 | 119 | """Set _called to True.""" | 117 | """Set _called to True.""" |
804 | 120 | self._called = (args, kwargs) | 118 | self._called = (args, kwargs) |
805 | @@ -123,9 +121,10 @@ | |||
806 | 123 | class CredentialsTestCase(BasicTestCase): | 121 | class CredentialsTestCase(BasicTestCase): |
807 | 124 | """Test suite for the Credentials class.""" | 122 | """Test suite for the Credentials class.""" |
808 | 125 | 123 | ||
809 | 124 | @defer.inlineCallbacks | ||
810 | 126 | def setUp(self): | 125 | def setUp(self): |
811 | 127 | """Init.""" | 126 | """Init.""" |
813 | 128 | super(CredentialsTestCase, self).setUp() | 127 | yield super(CredentialsTestCase, self).setUp() |
814 | 129 | self.obj = credentials.Credentials(success_cb=self.success, | 128 | self.obj = credentials.Credentials(success_cb=self.success, |
815 | 130 | error_cb=self.error, | 129 | error_cb=self.error, |
816 | 131 | denial_cb=self.denial, | 130 | denial_cb=self.denial, |
817 | @@ -360,8 +359,9 @@ | |||
818 | 360 | class PingUrlTestCase(CredentialsTestCase): | 359 | class PingUrlTestCase(CredentialsTestCase): |
819 | 361 | """Test suite for the URL pinging.""" | 360 | """Test suite for the URL pinging.""" |
820 | 362 | 361 | ||
821 | 362 | @defer.inlineCallbacks | ||
822 | 363 | def setUp(self): | 363 | def setUp(self): |
824 | 364 | super(PingUrlTestCase, self).setUp() | 364 | yield super(PingUrlTestCase, self).setUp() |
825 | 365 | self._request = None | 365 | self._request = None |
826 | 366 | 366 | ||
827 | 367 | def faked_urlopen(request): | 367 | def faked_urlopen(request): |
828 | @@ -552,8 +552,9 @@ | |||
829 | 552 | kwargs = {} | 552 | kwargs = {} |
830 | 553 | inner_class = FakedClientGUI | 553 | inner_class = FakedClientGUI |
831 | 554 | 554 | ||
832 | 555 | @defer.inlineCallbacks | ||
833 | 555 | def setUp(self): | 556 | def setUp(self): |
835 | 556 | super(RegisterTestCase, self).setUp() | 557 | yield super(RegisterTestCase, self).setUp() |
836 | 557 | self.inner_kwargs = UI_KWARGS.copy() | 558 | self.inner_kwargs = UI_KWARGS.copy() |
837 | 558 | self.inner_kwargs['login_only'] = self.login_only | 559 | self.inner_kwargs['login_only'] = self.login_only |
838 | 559 | self.method_call = getattr(self.obj, self.operation) | 560 | self.method_call = getattr(self.obj, self.operation) |
839 | @@ -649,8 +650,9 @@ | |||
840 | 649 | kwargs = {'email': EMAIL, 'password': PASSWORD} | 650 | kwargs = {'email': EMAIL, 'password': PASSWORD} |
841 | 650 | inner_class = FakedSSOLoginRoot | 651 | inner_class = FakedSSOLoginRoot |
842 | 651 | 652 | ||
843 | 653 | @defer.inlineCallbacks | ||
844 | 652 | def setUp(self): | 654 | def setUp(self): |
846 | 653 | super(LoginEmailPasswordTestCase, self).setUp() | 655 | yield super(LoginEmailPasswordTestCase, self).setUp() |
847 | 654 | self.inner_kwargs = {APP_NAME_KEY: APP_NAME, 'email': EMAIL, | 656 | self.inner_kwargs = {APP_NAME_KEY: APP_NAME, 'email': EMAIL, |
848 | 655 | 'password': PASSWORD, | 657 | 'password': PASSWORD, |
849 | 656 | 'result_cb': self.obj._login_success_cb, | 658 | 'result_cb': self.obj._login_success_cb, |
850 | 657 | 659 | ||
851 | === modified file 'ubuntu_sso/utils/tests/test_oauth_headers.py' | |||
852 | --- ubuntu_sso/utils/tests/test_oauth_headers.py 2011-10-06 21:46:56 +0000 | |||
853 | +++ ubuntu_sso/utils/tests/test_oauth_headers.py 2011-11-02 16:59:23 +0000 | |||
854 | @@ -191,8 +191,10 @@ | |||
855 | 191 | class TimestampCheckerTestCase(TestCase): | 191 | class TimestampCheckerTestCase(TestCase): |
856 | 192 | """Tests for the timestamp checker.""" | 192 | """Tests for the timestamp checker.""" |
857 | 193 | 193 | ||
858 | 194 | @defer.inlineCallbacks | ||
859 | 194 | def setUp(self): | 195 | def setUp(self): |
860 | 195 | """Initialize a fake webserver.""" | 196 | """Initialize a fake webserver.""" |
861 | 197 | yield super(TimestampCheckerTestCase, self).setUp() | ||
862 | 196 | self.ws = MockWebServer() | 198 | self.ws = MockWebServer() |
863 | 197 | self.addCleanup(self.ws.stop) | 199 | self.addCleanup(self.ws.stop) |
864 | 198 | self.patch(SyncTimestampChecker, "SERVER_URL", self.ws.get_url()) | 200 | self.patch(SyncTimestampChecker, "SERVER_URL", self.ws.get_url()) |
865 | 199 | 201 | ||
866 | === modified file 'ubuntu_sso/utils/tests/test_tcpactivation.py' | |||
867 | --- ubuntu_sso/utils/tests/test_tcpactivation.py 2011-07-15 14:25:35 +0000 | |||
868 | +++ ubuntu_sso/utils/tests/test_tcpactivation.py 2011-11-02 16:59:23 +0000 | |||
869 | @@ -71,8 +71,10 @@ | |||
870 | 71 | class AsyncSleepTestCase(TestCase): | 71 | class AsyncSleepTestCase(TestCase): |
871 | 72 | """Tests for the async_sleep function.""" | 72 | """Tests for the async_sleep function.""" |
872 | 73 | 73 | ||
873 | 74 | @defer.inlineCallbacks | ||
874 | 74 | def setUp(self): | 75 | def setUp(self): |
875 | 75 | """Initialize this test instance.""" | 76 | """Initialize this test instance.""" |
876 | 77 | yield super(AsyncSleepTestCase, self).setUp() | ||
877 | 76 | self.test_timeout = 5.0 | 78 | self.test_timeout = 5.0 |
878 | 77 | self.clock = task.Clock() | 79 | self.clock = task.Clock() |
879 | 78 | self.patch(tcpactivation, "reactor", self.clock) | 80 | self.patch(tcpactivation, "reactor", self.clock) |
880 | @@ -110,8 +112,10 @@ | |||
881 | 110 | 112 | ||
882 | 111 | timeout = 2 | 113 | timeout = 2 |
883 | 112 | 114 | ||
884 | 115 | @defer.inlineCallbacks | ||
885 | 113 | def setUp(self): | 116 | def setUp(self): |
886 | 114 | """Initialize this test instance.""" | 117 | """Initialize this test instance.""" |
887 | 118 | yield super(PortDetectFactoryTestCase, self).setUp() | ||
888 | 115 | self.factory = PortDetectFactory() | 119 | self.factory = PortDetectFactory() |
889 | 116 | 120 | ||
890 | 117 | @defer.inlineCallbacks | 121 | @defer.inlineCallbacks |
891 | @@ -169,8 +173,10 @@ | |||
892 | 169 | class ActivationDetectorTestCase(TestCase): | 173 | class ActivationDetectorTestCase(TestCase): |
893 | 170 | """Tests for the ActivationDetector class.""" | 174 | """Tests for the ActivationDetector class.""" |
894 | 171 | 175 | ||
895 | 176 | @defer.inlineCallbacks | ||
896 | 172 | def setUp(self): | 177 | def setUp(self): |
897 | 173 | """Initialize this test instance.""" | 178 | """Initialize this test instance.""" |
898 | 179 | yield super(ActivationDetectorTestCase, self).setUp() | ||
899 | 174 | self.config = ActivationConfig(SAMPLE_SERVICE, SAMPLE_CMDLINE, | 180 | self.config = ActivationConfig(SAMPLE_SERVICE, SAMPLE_CMDLINE, |
900 | 175 | SAMPLE_PORT) | 181 | SAMPLE_PORT) |
901 | 176 | 182 | ||
902 | @@ -206,8 +212,10 @@ | |||
903 | 206 | 212 | ||
904 | 207 | timeout = 2 | 213 | timeout = 2 |
905 | 208 | 214 | ||
906 | 215 | @defer.inlineCallbacks | ||
907 | 209 | def setUp(self): | 216 | def setUp(self): |
908 | 210 | """Initialize this test instance.""" | 217 | """Initialize this test instance.""" |
909 | 218 | yield super(ActivationClientTestCase, self).setUp() | ||
910 | 211 | self.config = ActivationConfig(SAMPLE_SERVICE, SAMPLE_CMDLINE, | 219 | self.config = ActivationConfig(SAMPLE_SERVICE, SAMPLE_CMDLINE, |
911 | 212 | SAMPLE_PORT) | 220 | SAMPLE_PORT) |
912 | 213 | 221 | ||
913 | @@ -292,8 +300,10 @@ | |||
914 | 292 | 300 | ||
915 | 293 | timeout = 2 | 301 | timeout = 2 |
916 | 294 | 302 | ||
917 | 303 | @defer.inlineCallbacks | ||
918 | 295 | def setUp(self): | 304 | def setUp(self): |
919 | 296 | """Initialize this test instance.""" | 305 | """Initialize this test instance.""" |
920 | 306 | yield super(ActivationInstanceTestCase, self).setUp() | ||
921 | 297 | self.config = ActivationConfig(SAMPLE_SERVICE, SAMPLE_CMDLINE, | 307 | self.config = ActivationConfig(SAMPLE_SERVICE, SAMPLE_CMDLINE, |
922 | 298 | SAMPLE_PORT) | 308 | SAMPLE_PORT) |
923 | 299 | 309 | ||
924 | 300 | 310 | ||
925 | === modified file 'ubuntu_sso/utils/tests/test_txsecrets.py' | |||
926 | --- ubuntu_sso/utils/tests/test_txsecrets.py 2011-07-05 15:26:05 +0000 | |||
927 | +++ ubuntu_sso/utils/tests/test_txsecrets.py 2011-11-02 16:59:23 +0000 | |||
928 | @@ -394,8 +394,9 @@ | |||
929 | 394 | timeout = 10 | 394 | timeout = 10 |
930 | 395 | secret_service_class = SecretServiceMock | 395 | secret_service_class = SecretServiceMock |
931 | 396 | 396 | ||
932 | 397 | @inlineCallbacks | ||
933 | 397 | def setUp(self): | 398 | def setUp(self): |
935 | 398 | super(BaseTestCase, self).setUp() | 399 | yield super(BaseTestCase, self).setUp() |
936 | 399 | self.session_bus = dbus.SessionBus() | 400 | self.session_bus = dbus.SessionBus() |
937 | 400 | self.mock_service = self.dbus_publish(txsecrets.SECRETS_SERVICE, | 401 | self.mock_service = self.dbus_publish(txsecrets.SECRETS_SERVICE, |
938 | 401 | self.secret_service_class) | 402 | self.secret_service_class) |
Please remove all the dummies:
@defer. inlineCallbacks onditionsTestCa se, self).setUp()
def setUp(self):
"""Set up."""
yield super(TermsAndC
@defer. inlineCallbacks onditionsTestCa se, self).tearDown()
def tearDown(self):
"""Tear down."""
yield super(TermsAndC
there is no need for that.
Also, there is a lint issue.