Logo Search packages:      
Sourcecode: magicicada version File versions  Download package

def magicicada::tests::test_magicicada::MagicicadaUIConnectionTestCase::assert_indicator_is_updated_correctly (   self,
  indicator 
)

Test that correctly updates the 'indicator'.

Definition at line 550 of file test_magicicada.py.

00550                                                               :
        """Test that correctly updates the 'indicator'."""
        cs = self.ui.sd.current_state
        for expected in (True, False):
            cs._set(**{indicator: expected})

            self.ui.update()

            self.assertEqual(self.ui.widget_enabled(self.ui.start),
                             not cs.is_started,
                             'start must be enabled if not started.')
            self.assertEqual(self.ui.widget_enabled(self.ui.stop),
                             cs.is_started,
                             'stop must be enabled if started.')

            if cs.is_started:
                actual = self.ui.widget_enabled(getattr(self.ui, indicator))
                self.assertEqual(expected, actual,
                                 '%s must be %s' % (indicator, expected))

                self.assertEqual(self.ui.widget_enabled(self.ui.connect),
                                 not cs.is_connected,
                                 'connect must be enabled if not connected.')
                self.assertEqual(self.ui.widget_enabled(self.ui.disconnect),
                                 cs.is_connected,
                                 'disconnect must be enabled if connected.')
            else:
                self.assertFalse(self.ui.connect.is_sensitive(),
                                 'connect must be disabled when %s' % cs)
                self.assertTrue(self.ui.widget_is_visible(self.ui.connect),
                                 'connect must be visible when %s' % cs)
                actual = self.ui.widget_enabled(getattr(self.ui, indicator))
                self.assertFalse(actual,
                                 '%s must be disabled' % (indicator,))

    def test_all_disabled_at_startup(self):


Generated by  Doxygen 1.6.0   Back to index