コード例 #1
0
ファイル: TestDescWordsLang.py プロジェクト: oscarpicas/rmtoo
    def test_pos_01(self):
        "DescWords: check language handling"

        tc = TestConfig1()
        lwords = DescWords.get_lang(tc)
        level, log = DescWords.analyse(lwords, "Me and You, You and Me")
        assert(level == -30)
        assert(log == [" -20:2*-10: Usage of the word 'and'"])
コード例 #2
0
    def test_check_language_handling(self):
        "DescWords: check language handling."

        tc = TestConfig1()
        lwords = DescWords.get_lang(tc)
        res = DescWords.analyse("lname", lwords, "Me and You, You and Me")
        assert(res.get_value() == -30)

        fd = StringIO.StringIO()
        res.write_error(fd)
        assert(fd.getvalue() == '''+++ Error:Analytics:DescWords:lname:result is '-30'
+++ Error:Analytics:DescWords:lname: -20:2*-10: Usage of the word 'and'
''')
コード例 #3
0
    def rmttest_check_language_handling(self):
        "DescWords: check language handling."

        test_config = TestConfig1()
        desc_words = DescWords(test_config)
        res = desc_words.analyse("lname", "Me and You, You and Me")
        assert -30 == res.get_value()

        fd = StringIO()
        res.write_error(fd)
        assert '''+++ Error:Analytics:DescWords:lname:result is '-30'
+++ Error:Analytics:DescWords:lname: -20:2*-10: Usage of the word 'and'
''' == fd.getvalue()
コード例 #4
0
ファイル: RMTTest-DescWordsLang.py プロジェクト: kown7/rmtoo
    def rmttest_check_language_handling(self):
        "DescWords: check language handling."

        test_config = TestConfig1()
        desc_words = DescWords(test_config)
        res = desc_words.analyse("lname", "Me and You, You and Me")
        assert -30 == res.get_value()

        fd = StringIO()
        res.write_error(fd)
        assert '''+++ Error:Analytics:DescWords:lname:result is '-30'
+++ Error:Analytics:DescWords:lname: -20:2*-10: Usage of the word 'and'
''' == fd.getvalue()
コード例 #5
0
ファイル: TestDescWordsLang.py プロジェクト: pnouvel/rmtoo
    def test_check_language_handling(self):
        "DescWords: check language handling."

        tc = TestConfig1()
        lwords = DescWords.get_lang(tc)
        res = DescWords.analyse("lname", lwords, "Me and You, You and Me")
        assert (res.get_value() == -30)

        fd = StringIO.StringIO()
        res.write_error(fd)
        assert (fd.getvalue() ==
                '''+++ Error:Analytics:DescWords:lname:result is '-30'
+++ Error:Analytics:DescWords:lname: -20:2*-10: Usage of the word 'and'
''')
コード例 #6
0
    def test_neg_02(self):
        "DescWords: get non existing language spec (wrong config)."

        tc = TestConfig2()
        lang = DescWords.get_lang(tc)
        assert(lang == DescWords.words_en_GB)
コード例 #7
0
    def rmttest_neg_02(self):
        "DescWords: get non existing language spec (wrong config)."

        tc = TestConfig2()
        lang = DescWords.get_lang(tc)
        self.assertEqual(lang, DescWords.words_en_GB)
コード例 #8
0
    def rmttest_neg_01(self):
        "DescWords: get non existing language spec (empty config)."

        tc = TestConfig2()
        lang = DescWords.get_lang(tc)
        assert lang == DescWords.words_en_GB
コード例 #9
0
ファイル: TestDescWordsLang.py プロジェクト: pnouvel/rmtoo
    def test_neg_02(self):
        "DescWords: get non existing language spec (wrong config)."

        tc = TestConfig2()
        lang = DescWords.get_lang(tc)
        assert (lang == DescWords.words_en_GB)
コード例 #10
0
ファイル: RMTTest-DescWordsLang.py プロジェクト: kown7/rmtoo
    def rmttest_neg_01(self):
        "DescWords: get non existing language spec (empty config)."

        tc = TestConfig2()
        lang = DescWords.get_lang(tc)
        assert lang == DescWords.words_en_GB
コード例 #11
0
ファイル: TestDescWordsLang.py プロジェクト: oscarpicas/rmtoo
    def test_neg_02(self):
        "DescWords: get non existing language spec using run function"

        tc = TestConfig2()
        r = DescWords.run(tc, None, None)
        assert(r == True)
コード例 #12
0
ファイル: TestDescWordsLang.py プロジェクト: oscarpicas/rmtoo
    def test_neg_01(self):
        "DescWords: get non existing language spec"

        tc = TestConfig2()
        lwords = DescWords.get_lang(tc)
        assert(lwords == None)