~ubuntuone-control-tower/ubuntuone-control-panel/trunk

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Natalia B. Bidart
  • Date: 2011-04-13 21:33:31 UTC
  • mfrom: (135.1.3 dont-start-syncdaemon)
  • Revision ID: tarmac-20110413213331-8i8d54cl8bkp5ld4
- Fixed (LP: #744731) with:
- Avoid creating a control-panel-backend in the OverviewPanel.
- Avoid FileSyncService and FileSyncStatus to start syncdaemon until load() is called.
- Make the dbus layer for the control panel backend not set the FileStatusChanged signal until is actually needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
445
445
 
446
446
    def test_sso_backend(self):
447
447
        """Has a correct SSO backend."""
448
 
        self.assertIsInstance(self.ui.sso_backend, FakedSSOBackend)
 
448
        self.assertIsInstance(self.ui.backend, FakedSSOBackend)
449
449
 
450
450
    def test_sso_backend_signals(self):
451
451
        """The proper signals are connected to the backend."""
452
 
        self.assertEqual(self.ui.sso_backend._signals['CredentialsFound'],
 
452
        self.assertEqual(self.ui.backend._signals['CredentialsFound'],
453
453
                         [self.ui.on_credentials_found])
454
 
        self.assertEqual(self.ui.sso_backend._signals['CredentialsNotFound'],
 
454
        self.assertEqual(self.ui.backend._signals['CredentialsNotFound'],
455
455
                         [self.ui.on_credentials_not_found])
456
 
        self.assertEqual(self.ui.sso_backend._signals['CredentialsError'],
 
456
        self.assertEqual(self.ui.backend._signals['CredentialsError'],
457
457
                         [self.ui.on_credentials_error])
458
 
        self.assertEqual(self.ui.sso_backend._signals['AuthorizationDenied'],
 
458
        self.assertEqual(self.ui.backend._signals['AuthorizationDenied'],
459
459
                         [self.ui.on_authorization_denied])
460
460
 
461
461
 
507
507
    def test_find_credentials_is_called(self):
508
508
        """Credentials are asked to SSO backend."""
509
509
        self.assertFalse(self.ui._credentials_are_new)
510
 
        self.assert_backend_called('find_credentials', (gui.U1_APP_NAME, {}),
511
 
                                   backend=self.ui.sso_backend)
 
510
        self.assert_backend_called('find_credentials', (gui.U1_APP_NAME, {}))
512
511
 
513
512
    def test_on_credentials_found(self):
514
513
        """Callback 'on_credentials_found' is correct."""
630
629
                 gui.HELP_TEXT_KEY: gui.U1_DESCRIPTION,
631
630
                 gui.WINDOW_ID_KEY: str(window_id),
632
631
                 gui.PING_URL_KEY: gui.U1_PING_URL})
633
 
        self.assert_backend_called('register', args,
634
 
                                   backend=self.ui.sso_backend)
 
632
        self.assert_backend_called('register', args)
635
633
 
636
634
    def test_connect_button_clicked(self):
637
635
        """Test the 'join now' button callback."""
646
644
                 gui.HELP_TEXT_KEY: gui.U1_DESCRIPTION,
647
645
                 gui.WINDOW_ID_KEY: str(window_id),
648
646
                 gui.PING_URL_KEY: gui.U1_PING_URL})
649
 
        self.assert_backend_called('login', args,
650
 
                                   backend=self.ui.sso_backend)
 
647
        self.assert_backend_called('login', args)
651
648
 
652
649
    def test_join_now_button_clicked_set_greyed(self):
653
650
        """Clicking on 'join_now' self is greyed."""