示例#1
0
    def test_get_default_helper_set_returns_default_values(self):
        application = Application()
        application.set_auto_exit(False)
        application.set_catch_exceptions(False)

        helper_set = application.get_helper_set()

        self.assertTrue(helper_set.has('formatter'))
        self.assertTrue(helper_set.has('question'))
示例#2
0
    def test_get_default_helper_set_returns_default_values(self):
        application = Application()
        application.set_auto_exit(False)
        application.set_catch_exceptions(False)

        helper_set = application.get_helper_set()

        self.assertTrue(helper_set.has("formatter"))
        self.assertTrue(helper_set.has("dialog"))
        self.assertTrue(helper_set.has("progress"))
示例#3
0
    def test_adding_single_helper_set_overwrites_default_values(self):
        application = Application()
        application.set_auto_exit(False)
        application.set_catch_exceptions(False)

        application.set_helper_set(HelperSet([FormatterHelper()]))

        helper_set = application.get_helper_set()

        self.assertTrue(helper_set.has('formatter'))
        self.assertFalse(helper_set.has('question'))
示例#4
0
    def test_adding_single_helper_set_overwrites_default_values(self):
        application = Application()
        application.set_auto_exit(False)
        application.set_catch_exceptions(False)

        application.set_helper_set(HelperSet({"formatter": FormatterHelper()}))

        helper_set = application.get_helper_set()

        self.assertTrue(helper_set.has("formatter"))
        self.assertFalse(helper_set.has("dialog"))
        self.assertFalse(helper_set.has("progress"))