コード例 #1
0
ファイル: test_dispatcher.py プロジェクト: durandj/mymcadmin
    def test_add_dict(self):
        """
        Tests the add_dict method
        """

        dispatcher = Dispatcher()
        dispatcher.add_dict(METHOD_MAP)

        self.assertDictEqual(METHOD_MAP, dispatcher.method_handlers, "Method map was not updated properly")
コード例 #2
0
ファイル: test_dispatcher.py プロジェクト: durandj/mymcadmin
    def test_add_dict_prefix(self):
        """
        Tests the add_dict method with a prefix
        """

        method_map = {("prefix." + k): v for k, v in METHOD_MAP.items()}
        dispatcher = Dispatcher()
        dispatcher.add_dict(METHOD_MAP, prefix="prefix")

        self.assertDictEqual(method_map, dispatcher.method_handlers, "Method map was not updated properly")