def test_event_triggering(self):
        for method in (self.context.poweron, self.context.resume,
                       self.context.pause, self.context.poweroff,
                       self.context.restart):
            for state in STATES:
                if method.__name__ in context.context.STATES_MAP[state]:
                    self.context.domain.state.return_value = [state]
                    self.hook.context.subscribe('pre_%s' % method.__name__,
                                                self.hook.pre_handler)
                    self.hook.context.subscribe('post_%s' % method.__name__,
                                                self.hook.post_handler)
                    method()
                    self.assertEqual(self.hook.pre_event,
                                     'pre_%s' % method.__name__)
                    self.assertEqual(self.hook.post_event,
                                     'post_%s' % method.__name__)
MOD and combinations
dataset/ETHPy150Open F-Secure/see/see/context/test/context_test.py/SeeContextTest.test_event_triggering--crossover with--dataset/ETHPy150Open algorhythms/HackerRankAlgorithms/Consecutive Subsequences.py/Solution.solve