~nataliabidart/ubuntuone-control-panel/applications-woohoo

« back to all changes in this revision

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

  • Committer: Natalia B. Bidart
  • Date: 2010-12-26 15:02:52 UTC
  • Revision ID: natalia.bidart@canonical.com-20101226150252-kg4432rxak3h5bw0
Handling ValueError when creating the replicationExclusion instance.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1649
1649
        """Has a replication service."""
1650
1650
        self.assertIsInstance(self.ui.replication_service, FakedReplication)
1651
1651
 
 
1652
    def test_no_pairing_record(self):
 
1653
        """The pairing record is not in place."""
 
1654
 
 
1655
        def no_pairing_record(*a):
 
1656
            """Fake a ReplicationExclusion with no pairing record."""
 
1657
            raise ValueError("No pairing record for ubuntuone.")
 
1658
 
 
1659
        self.ui.replication_exclusion_class = no_pairing_record
 
1660
        self.ui.replication_service = None
 
1661
        self.ui.load()
 
1662
 
 
1663
        self.assertEqual(self.ui.replications.get_children(), [])
 
1664
        self.assertFalse(self.ui.message.active)
 
1665
        self.assert_warning_correct(self.ui.message, self.ui.NO_PAIRING_RECORD)
 
1666
 
1652
1667
    def test_has_desktopcouch(self):
1653
1668
        """Has desktopcouch installed?"""
1654
1669
        self.assertTrue(self.ui.has_desktopcouch)