Exemplo n.º 1
0
    def test_ignore_square_brackets(self):
        sentence_1 = "[こんにちは]私の名前は[シャン]です。"
        case_1 = "私の名前はです。"

        self.assertEqual(get_preference('Option_IgnoreBracketContents'), False)
        self.assertEqual(replaceBracketContents(sentence_1), sentence_1)

        update_preferences({'Option_IgnoreBracketContents': True})
        self.assertEqual(replaceBracketContents(sentence_1), case_1)
Exemplo n.º 2
0
    def test_ignore_round_brackets_japanese(self):
        sentence_1 = "(こんにちは)私の名前は(シャン)です。"
        case_1 = "私の名前はです。"

        self.assertEqual(get_preference('Option_IgnoreRoundBracketContents'),
                         False)
        self.assertEqual(replaceBracketContents(sentence_1), sentence_1)

        update_preferences({'Option_IgnoreRoundBracketContents': True})
        self.assertEqual(replaceBracketContents(sentence_1), case_1)
Exemplo n.º 3
0
    def test_ignore_round_brackets_slim(self):
        sentence_1 = "(こんにちは)私の名前は(シャン)です。"
        case_1 = "私の名前はです。"

        self.assertEqual(
            get_preference('Option_IgnoreSlimRoundBracketContents'), False)
        self.assertEqual(replaceBracketContents(sentence_1), sentence_1)

        update_preferences({'Option_IgnoreSlimRoundBracketContents': True})
        self.assertEqual(replaceBracketContents(sentence_1), case_1)
Exemplo n.º 4
0
    def test_update_preferences(self):
        self.assertPreference('newly_inserted',
                              None)  # This preference does not exist yet, good
        update_preferences({'newly_inserted': 1111})
        self.assertPreference('newly_inserted', 1111)

        self.assertPreference('Field_FocusMorph',
                              'MorphMan_FocusMorph')  # Didn't broke default
        self.assertPreference('already_in_profile',
                              'yep')  # Didn't broke existing