From 19652f165e726396b6970df8cb8304ca20f9d437 Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Tue, 31 Dec 2019 20:17:26 -0500 Subject: [PATCH] Add test for get_handler_by_type() --- .../test/tracetools_analysis/test_processor.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tracetools_analysis/test/tracetools_analysis/test_processor.py b/tracetools_analysis/test/tracetools_analysis/test_processor.py index 2798f73..818bdad 100644 --- a/tracetools_analysis/test/tracetools_analysis/test_processor.py +++ b/tracetools_analysis/test/tracetools_analysis/test_processor.py @@ -159,6 +159,13 @@ class TestProcessor(unittest.TestCase): # Passes check Processor(EventHandlerWithRequiredEvent()).process([required_mock_event, mock_event]) + def test_get_handler_by_type(self) -> None: + handler1 = StubHandler1() + handler2 = StubHandler2() + processor = Processor(handler1, handler2) + result = processor.get_handler_by_type(StubHandler1) + self.assertTrue(result is handler1) + if __name__ == '__main__': unittest.main()