Merge lp:~thisfred/ubuntuone-client/lp-806668 into lp:ubuntuone-client

Proposed by Eric Casteleijn
Status: Merged
Approved by: Natalia Bidart
Approved revision: 1045
Merged at revision: 1044
Proposed branch: lp:~thisfred/ubuntuone-client/lp-806668
Merge into: lp:ubuntuone-client
Diff against target: 121 lines (+18/-9)
1 file modified
tests/platform/linux/test_dbus.py (+18/-9)
To merge this branch: bzr merge lp:~thisfred/ubuntuone-client/lp-806668
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Review via email: mp+67094@code.launchpad.net

Commit message

* Fixed more tests to play nice with twisted (LP: #806668)

Description of the change

* Fixed more tests to play nice with twisted (LP: #806668)

To post a comment you must log in.
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Looks great!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/platform/linux/test_dbus.py'
2--- tests/platform/linux/test_dbus.py 2011-06-28 17:25:05 +0000
3+++ tests/platform/linux/test_dbus.py 2011-07-06 21:42:36 +0000
4@@ -2230,9 +2230,10 @@
5
6 timeout = 2
7
8+ @defer.inlineCallbacks
9 def setUp(self):
10 """Init."""
11- super(TestSendingAllEvents, self).setUp()
12+ yield super(TestSendingAllEvents, self).setUp()
13 self.patch(DBusInterface, 'test', True)
14 self.patch(dbus, 'Interface', FakedSSOBackend)
15 self.patch(dbus.service, 'BusName', FakedBusName)
16@@ -2245,6 +2246,7 @@
17 self.main = FakeMain(self.root_dir, self.shares_dir,
18 self.data_dir, self.partials_dir)
19
20+ @defer.inlineCallbacks
21 def tearDown(self, *args):
22 """Shutdown."""
23 self.main.shutdown()
24@@ -2252,7 +2254,7 @@
25 self.rmtree(self.root_dir)
26 self.rmtree(self.data_dir)
27 self.rmtree(self.partials_dir)
28- super(TestSendingAllEvents, self).tearDown()
29+ yield super(TestSendingAllEvents, self).tearDown()
30
31 def test_not_active(self):
32 """All event listener is not subscribed by default."""
33@@ -2666,9 +2668,10 @@
34 method = 'register'
35 autoconnecting = False
36
37+ @defer.inlineCallbacks
38 def setUp(self):
39 """Init."""
40- super(DBusOAuthTestCase, self).setUp()
41+ yield super(DBusOAuthTestCase, self).setUp()
42 self.events = []
43 self.patch(DBusInterface, 'test', True)
44 self.patch(dbus, 'Interface', FakedSSOBackend)
45@@ -2689,6 +2692,7 @@
46 logger.addHandler(self.memento)
47 self.addCleanup(lambda: logger.removeHandler(self.memento))
48
49+ @defer.inlineCallbacks
50 def tearDown(self, *args):
51 """Shutdown."""
52 self.main.shutdown()
53@@ -2696,7 +2700,7 @@
54 self.rmtree(self.root_dir)
55 self.rmtree(self.data_dir)
56 self.rmtree(self.partials_dir)
57- super(DBusOAuthTestCase, self).tearDown()
58+ yield super(DBusOAuthTestCase, self).tearDown()
59
60 @defer.inlineCallbacks
61 def test_signals_are_connected(self):
62@@ -3506,9 +3510,10 @@
63 class TestStatusEmitSignals(DBusTwistedTestCase, MockerTestCase):
64 """Test that the emit method have been correctly implemented."""
65
66+ @defer.inlineCallbacks
67 def setUp(self):
68 """Setup tests."""
69- super(TestStatusEmitSignals, self).setUp()
70+ yield super(TestStatusEmitSignals, self).setUp()
71 self.signal_method = self.mocker.mock()
72
73 def test_emit_content_queue_changed(self):
74@@ -3663,9 +3668,10 @@
75 class TestSyncDaemonEmitSignals(DBusTwistedTestCase, MockerTestCase):
76 """Test that the emit method have been correctly implemented."""
77
78+ @defer.inlineCallbacks
79 def setUp(self):
80 """Setup tests."""
81- super(TestSyncDaemonEmitSignals, self).setUp()
82+ yield super(TestSyncDaemonEmitSignals, self).setUp()
83 self.signal_method = self.mocker.mock()
84
85
86@@ -3690,9 +3696,10 @@
87 class TestSharesEmitSignals(DBusTwistedTestCase, MockerTestCase):
88 """Test that the emit method have been correctly implemented."""
89
90+ @defer.inlineCallbacks
91 def setUp(self):
92 """Setup tests."""
93- super(TestSharesEmitSignals, self).setUp()
94+ yield super(TestSharesEmitSignals, self).setUp()
95 self.signal_method = self.mocker.mock()
96 self.shares.syncdaemon_shares = self.mocker.mock()
97 self.get_share_dict = self.mocker.replace(
98@@ -3838,9 +3845,10 @@
99 class TestFoldersEmitSignals(DBusTwistedTestCase, MockerTestCase):
100 """Test that the emit method have been correctly implemented."""
101
102+ @defer.inlineCallbacks
103 def setUp(self):
104 """Setup tests."""
105- super(TestFoldersEmitSignals, self).setUp()
106+ yield super(TestFoldersEmitSignals, self).setUp()
107 self.signal_method = self.mocker.mock()
108 self.get_udf_dict = self.mocker.replace(
109 'ubuntuone.syncdaemon.interaction_interfaces.get_udf_dict')
110@@ -3912,9 +3920,10 @@
111 class TestPublicFilesEmitSignals(DBusTwistedTestCase, MockerTestCase):
112 """Test that the emit method have been correctly implemented."""
113
114+ @defer.inlineCallbacks
115 def setUp(self):
116 """Setup tests."""
117- super(TestPublicFilesEmitSignals, self).setUp()
118+ yield super(TestPublicFilesEmitSignals, self).setUp()
119 self.signal_method = self.mocker.mock()
120 self.public_files.syncdaemon_public_files = self.mocker.mock()
121 self.bool_str = self.mocker.replace(

Subscribers

People subscribed via source and target branches