示例#1
0
    def test_add_reset_event(self):
        bb = BaseBar(x="key")
        self.result = None

        def test_func(event, callback):
            self.result = callback

        bb.add_event = test_func
        # test the following function behavior
        bb.add_reset_event(self.dashboard)
        assert self.result.__name__ == "reset_callback"
示例#2
0
    def test_add_events(self, event, result):
        bb = BaseBar(x="key")
        self.result = None

        def test_func(cls):
            self.result = "func_Called"

        bb.add_reset_event = test_func
        bb.reset_event = event
        # test the following function behavior
        bb.add_events(self.dashboard)

        assert self.result == result