Esempio n. 1
0
class TestBatteryDashWidget(unittest.TestCase):
    """
    @author: Isaac Saito
    """
    _WIDGET_NAME = 'Title sample'
    _widget = None

    def setUp(self):
        unittest.TestCase.setUp(self)
        #self._item = TreenodeQstdItem(self._nodename, 0) # For unknown reason this
        # stops operation.
        self._widget = BatteryDashWidget(self._WIDGET_NAME)

    def tearDown(self):
        #print 'Debug) in tearDown dict: {}'.format(self._widget.__dict__)

        unittest.TestCase.tearDown(self)
        del self._widget

    def test_update_time(self):
        val = '0.41'
        self._widget.update_time(val)

        print('toolTip={} name={}'.format(self._widget.toolTip(),
                                          self._widget._name))
        comp = "%s: %.2f%% remaining" % (self._WIDGET_NAME, float(val))
        tool_tip = self._widget.toolTip()
        self.assertEqual(comp, tool_tip)
class TestBatteryDashWidget(unittest.TestCase):
    """
    @author: Isaac Saito
    """
    _WIDGET_NAME = 'Title sample'
    _widget = None

    def setUp(self):
        unittest.TestCase.setUp(self)
        #self._item = TreenodeQstdItem(self._nodename, 0) # For unknown reason this
                                                       # stops operation.
        self._widget = BatteryDashWidget(self._WIDGET_NAME)
 
    def tearDown(self):
        #print 'Debug) in tearDown dict: {}'.format(self._widget.__dict__)

        unittest.TestCase.tearDown(self)
        del self._widget
                
    def test_update_time(self):
        val = '0.41'
        self._widget.update_time(val)

        print 'toolTip={} name={}'.format(self._widget.toolTip(),
                                          self._widget.name)
        comp = "%s: %.2f%% remaining" % (self._WIDGET_NAME, float(val))
        tool_tip = self._widget.toolTip()
        self.assertEqual(comp, tool_tip)
Esempio n. 3
0
 def setUp(self):
     unittest.TestCase.setUp(self)
     #self._item = TreenodeQstdItem(self._nodename, 0) # For unknown reason this
     # stops operation.
     self._widget = BatteryDashWidget(self._WIDGET_NAME)
 def setUp(self):
     unittest.TestCase.setUp(self)
     #self._item = TreenodeQstdItem(self._nodename, 0) # For unknown reason this
                                                    # stops operation.
     self._widget = BatteryDashWidget(self._WIDGET_NAME)