~alecu/ubuntuone-control-panel/the-outer-limits

« back to all changes in this revision

Viewing changes to ubuntuone/controlpanel/gtk/tests/test_gui.py

  • Committer: Tarmac
  • Author(s): Natalia B. Bidart
  • Date: 2011-03-09 21:16:14 UTC
  • mfrom: (91.2.4 services-redesign)
  • Revision ID: tarmac-20110309211614-dn457bybhtvt5lt5
  - Services tab is re-designed (LP: #729361).
  - Specific services tests were skipped due to LP: #729349.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
# Attribute 'yyy' defined outside __init__, access to a protected member
38
38
# pylint: disable=W0201, W0212
39
39
 
 
40
# Unused variable 'skip'
 
41
#pylint: disable=W0612
 
42
 
40
43
 
41
44
class DashboardTestCase(ControlPanelMixinTestCase):
42
45
    """The test suite for the dashboard panel."""
1097
1100
    klass = gui.Service
1098
1101
    service_id = 'dc_test'
1099
1102
    name = u'Qué lindo test!'
1100
 
    kwargs = {'service_id': service_id, 'name': name}
 
1103
    kwargs = {'service_id': service_id, 'name': name,
 
1104
              'container': None, 'check_button': None}
1101
1105
 
1102
1106
    def test_is_an_box(self):
1103
1107
        """Inherits from gtk.VBox."""
1134
1138
    klass = gui.FileSyncService
1135
1139
    service_id = 'file-sync'
1136
1140
    name = gui.FileSyncService.FILES_SERVICE_NAME
1137
 
    kwargs = {}
 
1141
    kwargs = {'container': None, 'check_button': None, 'action_button': None}
1138
1142
 
1139
1143
    def test_backend_account_signals(self):
1140
1144
        """The proper signals are connected to the backend."""
1195
1199
        self.ui.on_files_disabled()
1196
1200
        self.assertFalse(self.ui.button.get_active())
1197
1201
 
 
1202
FileSyncServiceTestCase.skip = 'LP: #729349'
 
1203
 
1198
1204
 
1199
1205
class DesktopcouchServiceTestCase(ServiceTestCase):
1200
1206
    """The test suite for a desktopcouch service."""
1299
1305
 
1300
1306
        self.assertEqual(self.ui.warning_label.get_text(), '')
1301
1307
 
 
1308
DesktopcouchServiceTestCase.skip = 'LP: #729349'
 
1309
 
1302
1310
 
1303
1311
class DesktopcouchServiceDisabledAtStartupTestCase(ServiceTestCase):
1304
1312
    """The test suite for a desktopcouch service when enabled=False."""
1341
1349
        self.assertEqual(sorted(self.ui.get_children()),
1342
1350
                         sorted([self.ui.button, self.ui.warning_label]))
1343
1351
 
 
1352
DesktopcouchServiceWithDependencyTestCase.skip = 'LP: #729349'
 
1353
 
1344
1354
 
1345
1355
class ServicesTestCase(ControlPanelMixinTestCase):
1346
1356
    """The test suite for the services panel."""
1389
1399
        child, = self.ui.files.get_children()
1390
1400
        self.assertIsInstance(child, gui.FileSyncService)
1391
1401
 
 
1402
    test_files_is_a_file_sync_service.skip = 'LP: #729349'
 
1403
 
1392
1404
 
1393
1405
class ServicesWithoutDesktopcouchTestCase(ServicesTestCase):
1394
1406
    """The test suite for the services panel when DC is not installed."""
1513
1525
        child, = self.ui.replications.get_children()
1514
1526
        self.assertEqual(child.button.get_label(), info[0]['name'])
1515
1527
 
 
1528
ServicesWithDesktopcouchTestCase.skip = 'LP: #729349'
 
1529
 
1516
1530
 
1517
1531
class ServicesWithDesktopcouchErrorTestCase(ServicesTestCase):
1518
1532
    """The test suite for the services panel."""
1555
1569
        self.assertFalse(self.ui.message.active)
1556
1570
        self.assert_warning_correct(self.ui.message, gui.VALUE_ERROR)
1557
1571
 
 
1572
ServicesWithDesktopcouchErrorTestCase.skip = 'LP: #729349'
 
1573
 
1558
1574
 
1559
1575
class FileSyncStatusTestCase(ControlPanelMixinTestCase):
1560
1576
    """Test case for a file sync status widget."""
1911
1927
 
1912
1928
        self.assertEqual(self._called, ((), {}))
1913
1929
 
1914
 
    def test_entering_services_tab_loads_content(self):
1915
 
        """The services info is loaded when entering the Devices tab."""
 
1930
    def test_entering_services_tab_does_not_load_content(self):
 
1931
        """The services info is not loaded when entering the Services tab."""
1916
1932
        self.patch(self.ui.services, 'load', self._set_called)
1917
1933
        # clean backend calls
1918
1934
        self.ui.services_button.clicked()
1919
1935
 
1920
 
        self.assertEqual(self._called, ((), {}))
 
1936
        self.assertEqual(self._called, False)
1921
1937
 
1922
1938
    def test_quota_placeholder_is_loading(self):
1923
1939
        """Placeholders for quota label is a Loading widget."""