/tests/core/test_filter_order.py
Python | 26 lines | 11 code | 7 blank | 8 comment | 1 complexity | 64f93be6a8d8c05b11a1bf366a465e1f MD5 | raw file
- # Module: test_filter_order
- # Date: 23rd February 2010
- # Author: James Mills, prologic at shortcircuit dot net dot au
- """Filter Order Tests
- Test that Event Handlers set as Filters are added and sorted
- such that Filters preceed non-filters.
- """
- from circuits import handler, Component
- class App(Component):
- def test(self, event, *args, **kwargs):
- pass
- @handler("test", filter=True)
- def on_test(self, event, *args, **kwargs):
- pass
- def test():
- app = App()
- handlers = app.channels.get(("*", "test"), [])
- assert handlers and handlers[0] == app.on_test