~ubuntu-branches/ubuntu/oneiric/ubuntuone-control-panel/oneiric

« back to all changes in this revision

Viewing changes to ubuntuone/controlpanel/gui/qt/tests/test_devices.py

* New upstream release:
  [ Alejandro J. Cura <alecu@canonical.com>]
    - Do not throw a webclient error when closing
      (LP: #845105).
  [ Natalia B. Bidart <natalia.bidart@canonical.com> ]
    - Removed all code related to Bookmarks (LP: #850142).
    - Replaces references to "Evolution" by "Thunderbird" (LP: #849494).
  [ Rodney Dawes <rodney.dawes@canonical.com> ]
    - Don't install a .desktop file for control panel
      (part of LP: #838778).
    - Point the indicator/Unity API at the installer .desktop file
      (part of LP: #838778).
    - Set the WMCLASS so Unity will fall back properly
      (part of LP: #838778).
    - Fix a few grammar mistakes (LP: #835093).
    - Don't show the "Get NGB free!" label on "Join now" button at all
      (LP: #819955).
* debian/control:
  - ubuntuone-control-panel-gtk depends now on ubuntuone-installer >= 2.0.0.
  - require ubuntuone-client >= 2.0.0.
  - require ubuntu-sso-client >= 1.4.0.
  - no longer install a .desktop file (will be installed by ubuntuone-installer).

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
from twisted.internet import defer
22
22
 
23
 
from ubuntuone.controlpanel.gui import qt
24
23
from ubuntuone.controlpanel.gui.qt import devices as gui
25
24
from ubuntuone.controlpanel.gui.qt.tests import (
26
 
    FakedConfirmDialog,
27
25
    SAMPLE_DEVICES_INFO,
28
26
)
29
27
from ubuntuone.controlpanel.gui.qt.tests.test_ubuntuonebin import (
42
40
    def setUp(self):
43
41
        yield super(DevicesPanelTestCase, self).setUp()
44
42
        self.ui.backend.next_result = SAMPLE_DEVICES_INFO
45
 
        self.patch(gui.QtGui, 'QMessageBox', FakedConfirmDialog)
46
43
 
47
44
    def test_is_processing_while_asking_info(self):
48
45
        """The ui is processing while the contents are loaded."""
97
94
 
98
95
    def test_manage_devices_button(self):
99
96
        """Clicking the manage devices button opens the proper url."""
100
 
        self.patch(qt, 'uri_hook', self._set_called)
101
 
        self.ui.ui.manage_devices_button.click()
102
 
 
103
 
        self.assertEqual(self._called, ((gui.EDIT_DEVICES_LINK,), {}))
 
97
        self.assert_uri_hook_called(self.ui.ui.manage_devices_button,
 
98
                                    gui.EDIT_DEVICES_LINK)
104
99
 
105
100
    def test_remove_device_widget_after_removal(self):
106
101
        """When a device widget was deleted, remove it from the UI."""
110
105
        local_device.removed.emit()
111
106
 
112
107
        self.assertTrue(self.ui.ui.local_device_box.itemAt(0) is None)
 
108
 
 
109
    def test_local_device_removed_signal(self):
 
110
        """When the local device is removed, emit localDeviceRemoved signal."""
 
111
        self.ui.localDeviceRemoved.connect(self._set_called)
 
112
        self.ui.process_info(SAMPLE_DEVICES_INFO)
 
113
 
 
114
        local_device = self.ui.ui.local_device_box.itemAt(0).widget()
 
115
        local_device.removed.emit()
 
116
 
 
117
        self.assertEqual(self._called, ((), {}))