Merge lp:~nataliabidart/ubuntuone-client/more-super-fixes into lp:ubuntuone-client
- more-super-fixes
- Merge into trunk
Proposed by
Natalia Bidart
Status: | Merged |
---|---|
Approved by: | Natalia Bidart |
Approved revision: | 1153 |
Merged at revision: | 1153 |
Proposed branch: | lp:~nataliabidart/ubuntuone-client/more-super-fixes |
Merge into: | lp:ubuntuone-client |
Diff against target: |
597 lines (+74/-189) 6 files modified
tests/platform/windows/test_credentials.py (+4/-2) tests/platform/windows/test_filesystem_notifications.py (+6/-4) tests/platform/windows/test_ipc.py (+51/-177) tests/platform/windows/test_network_manager.py (+4/-0) tests/platform/windows/test_pyinotify.py (+3/-1) tests/platform/windows/test_tools.py (+6/-5) |
To merge this branch: | bzr merge lp:~nataliabidart/ubuntuone-client/more-super-fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tim Cole (community) | Approve | ||
Review via email:
|
Commit message
- Windows tests do also need fix so super() is called (LP: #882446).
Description of the change
To post a comment you must log in.
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Tim Cole (tcole) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'tests/platform/windows/test_credentials.py' |
2 | --- tests/platform/windows/test_credentials.py 2011-09-13 19:31:23 +0000 |
3 | +++ tests/platform/windows/test_credentials.py 2011-10-28 18:48:24 +0000 |
4 | @@ -96,8 +96,9 @@ |
5 | class RemovableSignalTestCase(TestCase): |
6 | """Tests for RemovableSignal.""" |
7 | |
8 | + @defer.inlineCallbacks |
9 | def setUp(self): |
10 | - """Initialize this fake instance.""" |
11 | + yield super(RemovableSignalTestCase, self).setUp() |
12 | self.proxy = FakeSSOProxy() |
13 | |
14 | def test_creation(self): |
15 | @@ -153,8 +154,9 @@ |
16 | timeout = 5 |
17 | app_name = APP_NAME |
18 | |
19 | + @defer.inlineCallbacks |
20 | def setUp(self): |
21 | - """Initialize these tests.""" |
22 | + yield super(CredentialsManagementTestCase, self).setUp() |
23 | self._called = False |
24 | self.proxy = FakeSSOProxy() |
25 | self.cm = CredentialsManagement(self.proxy) |
26 | |
27 | === modified file 'tests/platform/windows/test_filesystem_notifications.py' |
28 | --- tests/platform/windows/test_filesystem_notifications.py 2011-10-18 13:27:44 +0000 |
29 | +++ tests/platform/windows/test_filesystem_notifications.py 2011-10-28 18:48:24 +0000 |
30 | @@ -107,9 +107,9 @@ |
31 | |
32 | timeout = 5 |
33 | |
34 | + @defer.inlineCallbacks |
35 | def setUp(self): |
36 | - """Set infor for the tests.""" |
37 | - super(TestWatch, self).setUp() |
38 | + yield super(TestWatch, self).setUp() |
39 | self.basedir = self.mktemp('test_root') |
40 | self.mask = FILE_NOTIFY_CHANGE_FILE_NAME | \ |
41 | FILE_NOTIFY_CHANGE_DIR_NAME | \ |
42 | @@ -834,9 +834,10 @@ |
43 | class TestWatchManager(BaseTwistedTestCase): |
44 | """Test the watch manager.""" |
45 | |
46 | + @defer.inlineCallbacks |
47 | def setUp(self): |
48 | """Set each of the tests.""" |
49 | - super(TestWatchManager, self).setUp() |
50 | + yield super(TestWatchManager, self).setUp() |
51 | self.parent_path = u'\\\\?\\C:\\' # a valid windows path |
52 | self.path = self.parent_path + u'path' |
53 | self.watch = Watch(1, self.path, None, True, None) |
54 | @@ -1109,9 +1110,10 @@ |
55 | class TestNotifyProcessor(BaseTwistedTestCase): |
56 | """Test the notify processor.""" |
57 | |
58 | + @defer.inlineCallbacks |
59 | def setUp(self): |
60 | """set up the diffeent tests.""" |
61 | - super(TestNotifyProcessor, self).setUp() |
62 | + yield super(TestNotifyProcessor, self).setUp() |
63 | self.processor = NotifyProcessor(None) |
64 | self.general = FakeGeneralProcessor() |
65 | self.processor.general_processor = self.general |
66 | |
67 | === modified file 'tests/platform/windows/test_ipc.py' |
68 | --- tests/platform/windows/test_ipc.py 2011-09-06 20:04:55 +0000 |
69 | +++ tests/platform/windows/test_ipc.py 2011-10-28 18:48:24 +0000 |
70 | @@ -101,11 +101,30 @@ |
71 | class BaseIPCTestCase(TestCase): |
72 | """Set the ipc to a random port for this instance.""" |
73 | |
74 | + @defer.inlineCallbacks |
75 | def setUp(self): |
76 | - """Initialize this test instance.""" |
77 | + yield super(BaseIPCTestCase, self).setUp() |
78 | self.patch(ipc, "get_sd_pb_port", lambda: TEST_PORT) |
79 | self.patch(ipc, "ActivationClient", FakeActivationClient) |
80 | |
81 | + @defer.inlineCallbacks |
82 | + def tearDown(self): |
83 | + yield super(BaseIPCTestCase, self).tearDown() |
84 | + if getattr(self, 'server_factory', None) is not None: |
85 | + if self.server_factory.protocolInstance is not None: |
86 | + self.server_factory.protocolInstance.transport.loseConnection() |
87 | + yield defer.gatherResults([self._tearDownServer(), |
88 | + self._tearDownClient()]) |
89 | + |
90 | + def _tearDownServer(self): |
91 | + """Teardown the server.""" |
92 | + return defer.maybeDeferred(self.listener.stopListening) |
93 | + |
94 | + def _tearDownClient(self): |
95 | + """Tear down the client.""" |
96 | + self.connector.disconnect() |
97 | + return defer.succeed(None) |
98 | + |
99 | |
100 | class SaveProtocolServerFactory(PBServerFactory): |
101 | """A PBServerFactory that saves the latest connected client.""" |
102 | @@ -144,9 +163,9 @@ |
103 | class SignalTestCase(MockerTestCase): |
104 | """Test the signal decorator.""" |
105 | |
106 | + @defer.inlineCallbacks |
107 | def setUp(self): |
108 | - """Set the tests.""" |
109 | - super(SignalTestCase, self).setUp() |
110 | + yield super(SignalTestCase, self).setUp() |
111 | self.fake_object = FakeDecoratedObject() |
112 | self.cb = self.mocker.mock() |
113 | |
114 | @@ -214,9 +233,9 @@ |
115 | class PerspectiveBrokerTestCase(TestCase): |
116 | """Base test case for the IPC used on Windows.""" |
117 | |
118 | + @defer.inlineCallbacks |
119 | def setUp(self): |
120 | - """Setup tests.""" |
121 | - super(PerspectiveBrokerTestCase, self).setUp() |
122 | + yield super(PerspectiveBrokerTestCase, self).setUp() |
123 | self.config = Config(None, None) |
124 | self.status = Status(None, None, None) |
125 | self.events = Events(None) |
126 | @@ -278,8 +297,9 @@ |
127 | class TestSignalBroadcaster(MockerTestCase): |
128 | """Test the signal broadcaster code.""" |
129 | |
130 | + @defer.inlineCallbacks |
131 | def setUp(self): |
132 | - super(TestSignalBroadcaster, self).setUp() |
133 | + yield super(TestSignalBroadcaster, self).setUp() |
134 | self.client = self.mocker.mock() |
135 | self.broad_caster = SignalBroadcaster() |
136 | |
137 | @@ -434,9 +454,9 @@ |
138 | class TestStatusEmitSignals(PerspectiveBrokerTestCase, MockerTestCase): |
139 | """Tests that the emit methods are correct.""" |
140 | |
141 | + @defer.inlineCallbacks |
142 | def setUp(self): |
143 | - """Setup tests.""" |
144 | - super(TestStatusEmitSignals, self).setUp() |
145 | + yield super(TestStatusEmitSignals, self).setUp() |
146 | self.signal_method = self.mocker.mock() |
147 | self.status.syncdaemon_status = self.mocker.mock() |
148 | self.status.emit_signal = self.signal_method |
149 | @@ -542,9 +562,9 @@ |
150 | class TestEventsEmitSignals(PerspectiveBrokerTestCase, MockerTestCase): |
151 | """Test that the emit method have been correctly implemented.""" |
152 | |
153 | + @defer.inlineCallbacks |
154 | def setUp(self): |
155 | - """Setup tests.""" |
156 | - super(TestEventsEmitSignals, self).setUp() |
157 | + yield super(TestEventsEmitSignals, self).setUp() |
158 | self.signal_method = self.mocker.mock() |
159 | self.events.emit_signal = self.signal_method |
160 | |
161 | @@ -562,9 +582,9 @@ |
162 | class TestSyncDaemonEmitSignals(PerspectiveBrokerTestCase, MockerTestCase): |
163 | """Test that the emit method have been correctly implemented.""" |
164 | |
165 | + @defer.inlineCallbacks |
166 | def setUp(self): |
167 | - """Setup tests.""" |
168 | - super(TestSyncDaemonEmitSignals, self).setUp() |
169 | + yield super(TestSyncDaemonEmitSignals, self).setUp() |
170 | self.signal_method = self.mocker.mock() |
171 | self.sync.emit_signal = self.signal_method |
172 | |
173 | @@ -587,9 +607,9 @@ |
174 | class TestSharesEmitSignals(PerspectiveBrokerTestCase, MockerTestCase): |
175 | """Test that the emit method have been correctly implemented.""" |
176 | |
177 | + @defer.inlineCallbacks |
178 | def setUp(self): |
179 | - """Setup tests.""" |
180 | - super(TestSharesEmitSignals, self).setUp() |
181 | + yield super(TestSharesEmitSignals, self).setUp() |
182 | self.signal_method = self.mocker.mock() |
183 | self.shares.emit_signal = self.signal_method |
184 | self.shares.syncdaemon_shares = self.mocker.mock() |
185 | @@ -727,9 +747,9 @@ |
186 | class TestFoldersEmitSignals(PerspectiveBrokerTestCase, MockerTestCase): |
187 | """Test that the emit method have been correctly implemented.""" |
188 | |
189 | + @defer.inlineCallbacks |
190 | def setUp(self): |
191 | - """Setup tests.""" |
192 | - super(TestFoldersEmitSignals, self).setUp() |
193 | + yield super(TestFoldersEmitSignals, self).setUp() |
194 | self.signal_method = self.mocker.mock() |
195 | self.folders.emit_signal = self.signal_method |
196 | self.get_udf_dict = self.mocker.replace( |
197 | @@ -798,9 +818,9 @@ |
198 | class TestPublicFilesEmitSignals(PerspectiveBrokerTestCase, MockerTestCase): |
199 | """Test that the emit method have been correctly implemented.""" |
200 | |
201 | + @defer.inlineCallbacks |
202 | def setUp(self): |
203 | - """Setup tests.""" |
204 | - super(TestPublicFilesEmitSignals, self).setUp() |
205 | + yield super(TestPublicFilesEmitSignals, self).setUp() |
206 | self.signal_method = self.mocker.mock() |
207 | self.public_files.emit_signal = self.signal_method |
208 | self.public_files.syncdaemon_public_files = self.mocker.mock() |
209 | @@ -887,8 +907,7 @@ |
210 | |
211 | @defer.inlineCallbacks |
212 | def setUp(self): |
213 | - """Setup tests.""" |
214 | - super(TestStatusClient, self).setUp() |
215 | + yield super(TestStatusClient, self).setUp() |
216 | self.mocker = Mocker() |
217 | self.root = self.mocker.mock() |
218 | self.status = Status(None, None, None) |
219 | @@ -901,22 +920,6 @@ |
220 | self.client_factory = PBClientFactory() |
221 | self.connector = yield ipc_client_connect(self.client_factory) |
222 | |
223 | - def tearDown(self): |
224 | - """Clean reactor.""" |
225 | - if self.server_factory.protocolInstance is not None: |
226 | - self.server_factory.protocolInstance.transport.loseConnection() |
227 | - return defer.gatherResults([self._tearDownServer(), |
228 | - self._tearDownClient()]) |
229 | - |
230 | - def _tearDownServer(self): |
231 | - """Teardown the server.""" |
232 | - return defer.maybeDeferred(self.listener.stopListening) |
233 | - |
234 | - def _tearDownClient(self): |
235 | - """Tear down the client.""" |
236 | - self.connector.disconnect() |
237 | - return defer.succeed(None) |
238 | - |
239 | @defer.inlineCallbacks |
240 | def _get_client(self): |
241 | """Get the client.""" |
242 | @@ -1285,8 +1288,7 @@ |
243 | |
244 | @defer.inlineCallbacks |
245 | def setUp(self): |
246 | - """Setup tests.""" |
247 | - super(TestEventsClient, self).setUp() |
248 | + yield super(TestEventsClient, self).setUp() |
249 | self.mocker = Mocker() |
250 | self.root = self.mocker.mock() |
251 | self.events = Events(None) |
252 | @@ -1299,22 +1301,6 @@ |
253 | self.client_factory = PBClientFactory() |
254 | self.connector = yield ipc_client_connect(self.client_factory) |
255 | |
256 | - def tearDown(self): |
257 | - """Clean reactor.""" |
258 | - if self.server_factory.protocolInstance is not None: |
259 | - self.server_factory.protocolInstance.transport.loseConnection() |
260 | - return defer.gatherResults([self._tearDownServer(), |
261 | - self._tearDownClient()]) |
262 | - |
263 | - def _tearDownServer(self): |
264 | - """Teardown the server.""" |
265 | - return defer.maybeDeferred(self.listener.stopListening) |
266 | - |
267 | - def _tearDownClient(self): |
268 | - """Tear down the client.""" |
269 | - self.connector.disconnect() |
270 | - return defer.succeed(None) |
271 | - |
272 | @defer.inlineCallbacks |
273 | def _get_client(self): |
274 | """Get the client.""" |
275 | @@ -1372,8 +1358,7 @@ |
276 | |
277 | @defer.inlineCallbacks |
278 | def setUp(self): |
279 | - """Setup tests.""" |
280 | - super(TestSyncDaemonClient, self).setUp() |
281 | + yield super(TestSyncDaemonClient, self).setUp() |
282 | self.mocker = Mocker() |
283 | self.root = self.mocker.mock() |
284 | self.daemon = SyncDaemon(None, None, None, None) |
285 | @@ -1386,22 +1371,6 @@ |
286 | self.client_factory = PBClientFactory() |
287 | self.connector = yield ipc_client_connect(self.client_factory) |
288 | |
289 | - def tearDown(self): |
290 | - """Clean reactor.""" |
291 | - if self.server_factory.protocolInstance is not None: |
292 | - self.server_factory.protocolInstance.transport.loseConnection() |
293 | - return defer.gatherResults([self._tearDownServer(), |
294 | - self._tearDownClient()]) |
295 | - |
296 | - def _tearDownServer(self): |
297 | - """Teardown the server.""" |
298 | - return defer.maybeDeferred(self.listener.stopListening) |
299 | - |
300 | - def _tearDownClient(self): |
301 | - """Tear down the client.""" |
302 | - self.connector.disconnect() |
303 | - return defer.succeed(None) |
304 | - |
305 | @defer.inlineCallbacks |
306 | def _get_client(self): |
307 | """Get the client.""" |
308 | @@ -1612,8 +1581,7 @@ |
309 | |
310 | @defer.inlineCallbacks |
311 | def setUp(self): |
312 | - """Setup tests.""" |
313 | - super(TestFileSystemClient, self).setUp() |
314 | + yield super(TestFileSystemClient, self).setUp() |
315 | self.mocker = Mocker() |
316 | self.root = self.mocker.mock() |
317 | self.fs = FileSystem(None, None) |
318 | @@ -1626,22 +1594,6 @@ |
319 | self.client_factory = PBClientFactory() |
320 | self.connector = yield ipc_client_connect(self.client_factory) |
321 | |
322 | - def tearDown(self): |
323 | - """Clean reactor.""" |
324 | - if self.server_factory.protocolInstance is not None: |
325 | - self.server_factory.protocolInstance.transport.loseConnection() |
326 | - return defer.gatherResults([self._tearDownServer(), |
327 | - self._tearDownClient()]) |
328 | - |
329 | - def _tearDownServer(self): |
330 | - """Teardown the server.""" |
331 | - return defer.maybeDeferred(self.listener.stopListening) |
332 | - |
333 | - def _tearDownClient(self): |
334 | - """Tear down the client.""" |
335 | - self.connector.disconnect() |
336 | - return defer.succeed(None) |
337 | - |
338 | @defer.inlineCallbacks |
339 | def _get_client(self): |
340 | """Get the client.""" |
341 | @@ -1728,8 +1680,7 @@ |
342 | |
343 | @defer.inlineCallbacks |
344 | def setUp(self): |
345 | - """Setup tests.""" |
346 | - super(TestSyncDaemonClient, self).setUp() |
347 | + yield super(TestSyncDaemonClient, self).setUp() |
348 | self.mocker = Mocker() |
349 | self.root = self.mocker.mock() |
350 | self.get_share_dict = self.mocker.replace( |
351 | @@ -1744,17 +1695,6 @@ |
352 | self.client_factory = PBClientFactory() |
353 | self.connector = yield ipc_client_connect(self.client_factory) |
354 | |
355 | - def tearDown(self): |
356 | - """Clean reactor.""" |
357 | - if self.server_factory.protocolInstance is not None: |
358 | - self.server_factory.protocolInstance.transport.loseConnection() |
359 | - return defer.gatherResults([self._tearDownServer(), |
360 | - self._tearDownClient()]) |
361 | - |
362 | - def _tearDownServer(self): |
363 | - """Teardown the server.""" |
364 | - return defer.maybeDeferred(self.listener.stopListening) |
365 | - |
366 | def _tearDownClient(self): |
367 | """Tear down the client.""" |
368 | self.connector.disconnect() |
369 | @@ -2219,8 +2159,7 @@ |
370 | |
371 | @defer.inlineCallbacks |
372 | def setUp(self): |
373 | - """Setup tests.""" |
374 | - super(TestConfigClient, self).setUp() |
375 | + yield super(TestConfigClient, self).setUp() |
376 | self.mocker = Mocker() |
377 | self.root = self.mocker.mock() |
378 | self.config = Config(None, None) |
379 | @@ -2233,22 +2172,6 @@ |
380 | self.client_factory = PBClientFactory() |
381 | self.connector = yield ipc_client_connect(self.client_factory) |
382 | |
383 | - def tearDown(self): |
384 | - """Clean reactor.""" |
385 | - if self.server_factory.protocolInstance is not None: |
386 | - self.server_factory.protocolInstance.transport.loseConnection() |
387 | - return defer.gatherResults([self._tearDownServer(), |
388 | - self._tearDownClient()]) |
389 | - |
390 | - def _tearDownServer(self): |
391 | - """Teardown the server.""" |
392 | - return defer.maybeDeferred(self.listener.stopListening) |
393 | - |
394 | - def _tearDownClient(self): |
395 | - """Tear down the client.""" |
396 | - self.connector.disconnect() |
397 | - return defer.succeed(None) |
398 | - |
399 | @defer.inlineCallbacks |
400 | def _get_client(self): |
401 | """Get the client.""" |
402 | @@ -2593,8 +2516,7 @@ |
403 | |
404 | @defer.inlineCallbacks |
405 | def setUp(self): |
406 | - """Setup tests.""" |
407 | - super(TestFoldersClient, self).setUp() |
408 | + yield super(TestFoldersClient, self).setUp() |
409 | self.mocker = Mocker() |
410 | self.root = self.mocker.mock() |
411 | self.folders = Folders(None, None) |
412 | @@ -2607,22 +2529,6 @@ |
413 | self.client_factory = PBClientFactory() |
414 | self.connector = yield ipc_client_connect(self.client_factory) |
415 | |
416 | - def tearDown(self): |
417 | - """Clean reactor.""" |
418 | - if self.server_factory.protocolInstance is not None: |
419 | - self.server_factory.protocolInstance.transport.loseConnection() |
420 | - return defer.gatherResults([self._tearDownServer(), |
421 | - self._tearDownClient()]) |
422 | - |
423 | - def _tearDownServer(self): |
424 | - """Teardown the server.""" |
425 | - return defer.maybeDeferred(self.listener.stopListening) |
426 | - |
427 | - def _tearDownClient(self): |
428 | - """Tear down the client.""" |
429 | - self.connector.disconnect() |
430 | - return defer.succeed(None) |
431 | - |
432 | @defer.inlineCallbacks |
433 | def _get_client(self): |
434 | """Get the client.""" |
435 | @@ -2952,8 +2858,7 @@ |
436 | |
437 | @defer.inlineCallbacks |
438 | def setUp(self): |
439 | - """Setup tests.""" |
440 | - super(TestPublicFilesClient, self).setUp() |
441 | + yield super(TestPublicFilesClient, self).setUp() |
442 | self.mocker = Mocker() |
443 | self.root = self.mocker.mock() |
444 | self.files = PublicFiles(None, None) |
445 | @@ -2966,22 +2871,6 @@ |
446 | self.client_factory = PBClientFactory() |
447 | self.connector = yield ipc_client_connect(self.client_factory) |
448 | |
449 | - def tearDown(self): |
450 | - """Clean reactor.""" |
451 | - if self.server_factory.protocolInstance is not None: |
452 | - self.server_factory.protocolInstance.transport.loseConnection() |
453 | - return defer.gatherResults([self._tearDownServer(), |
454 | - self._tearDownClient()]) |
455 | - |
456 | - def _tearDownServer(self): |
457 | - """Teardown the server.""" |
458 | - return defer.maybeDeferred(self.listener.stopListening) |
459 | - |
460 | - def _tearDownClient(self): |
461 | - """Tear down the client.""" |
462 | - self.connector.disconnect() |
463 | - return defer.succeed(None) |
464 | - |
465 | @defer.inlineCallbacks |
466 | def _get_client(self): |
467 | """Get the client.""" |
468 | @@ -3132,9 +3021,9 @@ |
469 | class TestAllEventsSender(MockerTestCase): |
470 | """Test the status client class.""" |
471 | |
472 | + @defer.inlineCallbacks |
473 | def setUp(self): |
474 | - """Setup tests.""" |
475 | - super(TestAllEventsSender, self).setUp() |
476 | + yield super(TestAllEventsSender, self).setUp() |
477 | self.events = self.mocker.mock() |
478 | self.sender = AllEventsSender(self.events) |
479 | |
480 | @@ -3195,7 +3084,7 @@ |
481 | |
482 | @defer.inlineCallbacks |
483 | def setUp(self): |
484 | - super(TestIPCRoot, self).setUp() |
485 | + yield super(TestIPCRoot, self).setUp() |
486 | self.mocker = Mocker() |
487 | self.main = self.mocker.mock() |
488 | # diff objects that will be exposed by root |
489 | @@ -3211,22 +3100,6 @@ |
490 | self.connector = yield ipc_client_connect(self.client_factory) |
491 | self.mocker.reset() |
492 | |
493 | - def tearDown(self): |
494 | - """Clean reactor.""" |
495 | - if self.server_factory.protocolInstance is not None: |
496 | - self.server_factory.protocolInstance.transport.loseConnection() |
497 | - return defer.gatherResults([self._tearDownServer(), |
498 | - self._tearDownClient()]) |
499 | - |
500 | - def _tearDownServer(self): |
501 | - """Teardown the server.""" |
502 | - return defer.maybeDeferred(self.listener.stopListening) |
503 | - |
504 | - def _tearDownClient(self): |
505 | - """Tear down the client.""" |
506 | - self.connector.disconnect() |
507 | - return defer.succeed(None) |
508 | - |
509 | @defer.inlineCallbacks |
510 | def _get_client(self): |
511 | """Get the client.""" |
512 | @@ -3459,8 +3332,9 @@ |
513 | |
514 | cmt_class = None |
515 | |
516 | + @defer.inlineCallbacks |
517 | def setUp(self): |
518 | - """Initialize this test instance.""" |
519 | + yield super(IPCInterfaceTestCaseBase, self).setUp() |
520 | if self.cmt_class is None: return |
521 | self.patch(ipc, "CredentialsManagementTool", self.cmt_class) |
522 | self.patch(ipc, "IPCRoot", FakeIPCRoot) |
523 | |
524 | === modified file 'tests/platform/windows/test_network_manager.py' |
525 | --- tests/platform/windows/test_network_manager.py 2011-02-23 00:21:54 +0000 |
526 | +++ tests/platform/windows/test_network_manager.py 2011-10-28 18:48:24 +0000 |
527 | @@ -15,10 +15,14 @@ |
528 | # |
529 | # You should have received a copy of the GNU General Public License along |
530 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
531 | + |
532 | """Tests for the network manager.""" |
533 | + |
534 | from mocker import MockerTestCase |
535 | + |
536 | from ubuntuone.platform.windows.network_manager import NetworkManager |
537 | |
538 | + |
539 | class TestNetworkManager(MockerTestCase): |
540 | """Test he Network Manager.""" |
541 | |
542 | |
543 | === modified file 'tests/platform/windows/test_pyinotify.py' |
544 | --- tests/platform/windows/test_pyinotify.py 2011-07-05 11:24:00 +0000 |
545 | +++ tests/platform/windows/test_pyinotify.py 2011-10-28 18:48:24 +0000 |
546 | @@ -17,6 +17,7 @@ |
547 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
548 | """Test for the pyinotify implementation on windows.""" |
549 | |
550 | +from twisted.internet import defer |
551 | from twisted.trial.unittest import TestCase |
552 | |
553 | from ubuntuone.platform.windows.pyinotify import RawOutputFormat |
554 | @@ -24,8 +25,9 @@ |
555 | class RawOutputFormatTest(TestCase): |
556 | """Test te formatter to ensure it can deal with mbcs.""" |
557 | |
558 | + @defer.inlineCallbacks |
559 | def setUp(self): |
560 | - """Set tests.""" |
561 | + yield super(RawOutputFormatTest, self).setUp() |
562 | self.format = {'normal': 'normal'} |
563 | self.formatter = RawOutputFormat(self.format) |
564 | |
565 | |
566 | === modified file 'tests/platform/windows/test_tools.py' |
567 | --- tests/platform/windows/test_tools.py 2011-07-28 13:57:56 +0000 |
568 | +++ tests/platform/windows/test_tools.py 2011-10-28 18:48:24 +0000 |
569 | @@ -107,9 +107,9 @@ |
570 | class TestSyncDaemonTool(TestCase): |
571 | """Various utility methods to test/play with the SyncDaemon.""" |
572 | |
573 | + @defer.inlineCallbacks |
574 | def setUp(self): |
575 | - """Set up the different tests.""" |
576 | - super(TestSyncDaemonTool, self).setUp() |
577 | + yield super(TestSyncDaemonTool, self).setUp() |
578 | self.mocker = Mocker() |
579 | self.root = self.mocker.mock() |
580 | self.status = Status(None, None, None) |
581 | @@ -142,12 +142,13 @@ |
582 | self.listener = ipc_server_listen(self.server_factory) |
583 | self.sdtool = SyncDaemonTool() |
584 | |
585 | + @defer.inlineCallbacks |
586 | def tearDown(self): |
587 | - """Clean reactor.""" |
588 | + yield super(TestSyncDaemonTool, self).tearDown() |
589 | if self.server_factory.protocolInstance is not None: |
590 | self.server_factory.protocolInstance.transport.loseConnection() |
591 | - return defer.gatherResults([self._tearDownServer(), |
592 | - self._tearDownClient()]) |
593 | + yield defer.gatherResults([self._tearDownServer(), |
594 | + self._tearDownClient()]) |
595 | |
596 | def _tearDownServer(self): |
597 | """Teardown the server.""" |