Пример #1
0
class ButtonsTest(MockTestCase):
    def setUp(self):
        self.picolcd = self.mock()
        self.picolcd.leds = [0, 0, 0, 0, 0, 0, 0]
        self.button = Button(self.picolcd, 'OK', buttons.XK_F1, 5)

    def testInstantiation(self):
        pass

    def testSetBacklight(self):
        self.picolcd.expects(once()).updateLeds()
        self.button.setBacklight(True)
        self.failUnlessEqual([0, 0, 0, 0, 0, 1, 0], self.picolcd.leds)
Пример #2
0
class ButtonsTest(MockTestCase):

    def setUp(self):
        self.picolcd = self.mock()
        self.picolcd.leds = [0, 0, 0, 0, 0, 0, 0]
        self.button = Button(self.picolcd, 'OK', buttons.XK_F1, 5)

    def testInstantiation(self):
        pass

    def testSetBacklight(self):
        self.picolcd.expects(once()).updateLeds()
        self.button.setBacklight(True)
        self.failUnlessEqual([0, 0, 0, 0, 0, 1, 0], self.picolcd.leds)