Merge lp:~mandel/ubuntuone-client/add_dbus_syndaemon_signal_tests into lp:ubuntuone-client

Proposed by Manuel de la Peña
Status: Merged
Approved by: Manuel de la Peña
Approved revision: 865
Merged at revision: 880
Proposed branch: lp:~mandel/ubuntuone-client/add_dbus_syndaemon_signal_tests
Merge into: lp:ubuntuone-client
Prerequisite: lp:~mandel/ubuntuone-client/add_dbus_events_signal_tests
Diff against target: 37 lines (+27/-0)
1 file modified
tests/platform/linux/test_dbus.py (+27/-0)
To merge this branch: bzr merge lp:~mandel/ubuntuone-client/add_dbus_syndaemon_signal_tests
Reviewer Review Type Date Requested Status
Facundo Batista (community) Approve
John O'Brien (community) Approve
Review via email: mp+50345@code.launchpad.net

Commit message

Add extra tests for the SyncDaemon emit signals.

Description of the change

Add extra tests for the SyncDaemon emit signals.

To post a comment you must log in.
Revision history for this message
John O'Brien (jdobrien) wrote :

nice...

review: Approve
863. By Manuel de la Peña

Merged with branch that provides test for the emit methods in the Events class.

864. By Manuel de la Peña

Merged with branch that provides test for the emit methods in the SyncDaemon class.

865. By Manuel de la Peña

Merged add_dbus_events_signal_tests into add_dbus_syndaemon_signal_tests.

Revision history for this message
Facundo Batista (facundo) wrote :

Good

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-02-21 09:30:58 +0000
3+++ tests/platform/linux/test_dbus.py 2011-02-21 09:30:58 +0000
4@@ -3632,6 +3632,33 @@
5 self.events.emit_event(event)
6
7
8+class TestSyncDaemonEmitSignals(DBusTwistedTestCase, MockerTestCase):
9+ """Test that the emit method have been correctly implemented."""
10+
11+ def setUp(self):
12+ """Setup tests."""
13+ super(TestSyncDaemonEmitSignals, self).setUp()
14+ self.signal_method = self.mocker.mock()
15+
16+
17+ def test_emit_root_mismatch(self):
18+ """Emit RootMismatch signal."""
19+ root_id = 'root_id'
20+ new_root_id = 'new_root_id'
21+ self.sync.RootMismatch = self.signal_method
22+ self.signal_method(root_id, new_root_id)
23+ self.mocker.replay()
24+ self.sync.emit_root_mismatch(root_id, new_root_id)
25+
26+ def test_emit_quota_exceeded(self):
27+ """Emit QuotaExceeded signal."""
28+ volume_dict = 'volume_dict'
29+ self.sync.QuotaExceeded = self.signal_method
30+ self.signal_method(volume_dict)
31+ self.mocker.replay()
32+ self.sync.emit_quota_exceeded(volume_dict)
33+
34+
35 def test_suite():
36 """Collect these tests only on linux."""
37 import sys

Subscribers

People subscribed via source and target branches