コード例 #1
0
ファイル: button_test.py プロジェクト: orospakr/peephole
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
ファイル: button_test.py プロジェクト: credil/peephole
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)