Exemple #1
0
    def test_add_method(self):
        """
        Tests the add_method method with a name
        """

        dispatcher = Dispatcher()
        dispatcher.add_method(func1, name="test")

        self.assertDictEqual({"test": func1}, dispatcher.method_handlers, "Method map was not updated properly")
Exemple #2
0
    def test_add_method_non_coroutine(self):
        """
        Tests that the add_method method doesn't accept regular functions
        """

        def _i_fail():
            pass

        dispatcher = Dispatcher()
        dispatcher.add_method(_i_fail)