예제 #1
0
파일: core.py 프로젝트: de-michiel/thot
 def test_event_dispatch_specific_method(self):
     """ Tests if events are being dispatched for all plugins """
     event_handler = EventHandler([TestPlugin()])
     result = event_handler.dispatch('on_before_parse_args',
                                     [optparse.OptionParser()])
     for plugin in event_handler._plugins:
         self.assertEqual("on_before_parse_args", result[plugin.name()])
예제 #2
0
파일: core.py 프로젝트: de-michiel/thot
    def test_initial_state(self):
        """ Tests if on init everything is clear """
        event_handler = EventHandler([])
        self.assertEqual(event_handler._plugins, [])

        plugins = [TestPlugin()]
        event_handler = EventHandler(plugins)
        self.assertEqual(event_handler._plugins, plugins)
예제 #3
0
파일: core.py 프로젝트: de-michiel/thot
 def test_event_dispatch_default_method(self):
     """ Tests if events are being dispatched for all plugins """
     event_handler = EventHandler([TestPlugin()])
     result = event_handler.dispatch('on_after_parse_args', [dict()])
     for plugin in event_handler._plugins:
         self.assertEqual("on_after_parse_args", result[plugin.name()])
예제 #4
0
파일: core.py 프로젝트: bellthoven/thot
	def test_event_dispatch_default_method(self):
		""" Tests if events are being dispatched for all plugins """
		event_handler = EventHandler([TestPlugin()])
		result = event_handler.dispatch('on_after_parse_args', [dict()])
		for plugin in event_handler._plugins:
			self.assertEqual("on_after_parse_args", result[plugin.name()])
예제 #5
0
파일: core.py 프로젝트: bellthoven/thot
	def test_event_dispatch_specific_method(self):
		""" Tests if events are being dispatched for all plugins """
		event_handler = EventHandler([TestPlugin()])
		result = event_handler.dispatch('on_before_parse_args', [optparse.OptionParser()])
		for plugin in event_handler._plugins:
			self.assertEqual("on_before_parse_args", result[plugin.name()])