Merge lp:~mikemc/ubuntuone-client/fix-dummy-sync-menu into lp:ubuntuone-client

Proposed by Mike McCracken
Status: Merged
Approved by: Mike McCracken
Approved revision: 1327
Merged at revision: 1327
Proposed branch: lp:~mikemc/ubuntuone-client/fix-dummy-sync-menu
Merge into: lp:ubuntuone-client
Prerequisite: lp:~diegosarmentero/ubuntuone-client/ubuntuone-client-timer
Diff against target: 72 lines (+55/-1)
2 files modified
tests/platform/sync_menu/test_common.py (+49/-0)
ubuntuone/platform/sync_menu/common.py (+6/-1)
To merge this branch: bzr merge lp:~mikemc/ubuntuone-client/fix-dummy-sync-menu
Reviewer Review Type Date Requested Status
Brian Curtin (community) Approve
Diego Sarmentero (community) Approve
Review via email: mp+126766@code.launchpad.net

This proposal supersedes a proposal from 2012-09-24.

Commit message

- Fix dummy sync menu implementation for windows and darwin. (LP: #1055840)

Description of the change

- Fix dummy sync menu implementation for windows and darwin. (LP: #1055840)

Added a test to check that the dummy class has the same API, fixed missing function.

Tests pass on darwin and linux (precise).
(On darwin, I only ran the specific tests that changed, since trunk tests have never worked.)

With this fix, an app built from trunk runs correctly on darwin again.

To post a comment you must log in.
1327. By Mike McCracken

merge with trunk

Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve
Revision history for this message
Brian Curtin (brian.curtin) wrote :

Looks alright to me, tests pass on Windows.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'tests/platform/sync_menu/test_common.py'
--- tests/platform/sync_menu/test_common.py 1970-01-01 00:00:00 +0000
+++ tests/platform/sync_menu/test_common.py 2012-09-27 19:25:25 +0000
@@ -0,0 +1,49 @@
1# -*- coding: utf-8 *-*
2#
3# Copyright 2012 Canonical Ltd.
4#
5# This program is free software: you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.
8#
9# This program is distributed in the hope that it will be useful, but
10# WITHOUT ANY WARRANTY; without even the implied warranties of
11# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
12# PURPOSE. See the GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with this program. If not, see <http://www.gnu.org/licenses/>.
16#
17# In addition, as a special exception, the copyright holders give
18# permission to link the code of portions of this program with the
19# OpenSSL library under certain conditions as described in each
20# individual source file, and distribute linked combinations
21# including the two.
22# You must obey the GNU General Public License in all respects
23# for all of the code used other than OpenSSL. If you modify
24# file(s) with this exception, you may extend this exception to your
25# version of the file(s), but you are not obligated to do so. If you
26# do not wish to do so, delete this exception statement from your
27# version. If you delete this exception statement from all source
28# files in the program, then also delete it here.
29"""Test the common dummy Sync Menu implementation for win32/darwin."""
30
31from collections import Callable
32
33from twisted.trial.unittest import TestCase
34
35from ubuntuone.platform.sync_menu import common
36
37
38class SyncMenuDummyTestCase(TestCase):
39 """Test the SyncMenu."""
40
41 def test_dummy_support(self):
42 """Can we create a Dummy with the same #args as the real obj."""
43 dummy = common.UbuntuOneSyncMenu(1, 2)
44 self.assertIsInstance(dummy, common.UbuntuOneSyncMenu)
45
46 def test_dummy_has_update_transfers(self):
47 """Check that the dummy has the proper methods required by the API."""
48 dummy = common.UbuntuOneSyncMenu(1, 2)
49 self.assertIsInstance(dummy.update_transfers, Callable)
050
=== modified file 'ubuntuone/platform/sync_menu/common.py'
--- ubuntuone/platform/sync_menu/common.py 2012-09-20 12:56:32 +0000
+++ ubuntuone/platform/sync_menu/common.py 2012-09-27 19:25:25 +0000
@@ -26,8 +26,13 @@
26# do not wish to do so, delete this exception statement from your26# do not wish to do so, delete this exception statement from your
27# version. If you delete this exception statement from all source27# version. If you delete this exception statement from all source
28# files in the program, then also delete it here.28# files in the program, then also delete it here.
29"""Use SyncMenu lib to integrate U1 with the Systray Sync Icon."""29"""Dummy implementation of sync_menu lib for win32 and darwin."""
3030
3131
32class UbuntuOneSyncMenu(object):32class UbuntuOneSyncMenu(object):
33 """Integrate U1 with the Ubuntu Sync Menu."""33 """Integrate U1 with the Ubuntu Sync Menu."""
34 def __init__(self, status, syncdaemon_service):
35 """Match #args of linux syncmenu and do nothing."""
36
37 def update_transfers(self):
38 """Do nothing."""

Subscribers

People subscribed via source and target branches