Grammalecte  Check-in [0207fe1b5b]

Overview
Comment:[fr] tests update
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fr | bdic_opt
Files: files | file ages | folders
SHA3-256: 0207fe1b5bd52f31e8d5cbee81c1ad40a6cb2be96bce4f6409dc3df9485eabe8
User & Date: olr on 2020-09-12 12:22:28
Other Links: branch diff | manifest | tags
Context
2020-09-12
12:32
[graphspell][js] ibdawg: code cleaning, remove version 2 and 3, never used check-in: b3f2f1d72a user: olr tags: graphspell, bdic_opt
12:22
[fr] tests update check-in: 0207fe1b5b user: olr tags: fr, bdic_opt
2020-09-11
19:20
merge trunk check-in: 43afb8b856 user: olr tags: bdic_opt
Changes

Modified gc_lang/fr/modules/tests_modules.py from [1156e862bc] to [8a9c45807b].

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
def timeblock (label, hDst=None):
    "performance counter (contextmanager)"
    start = time.perf_counter()
    try:
        yield
    finally:
        end = time.perf_counter()
        print('{} : {}'.format(label, end - start))
        if hDst:
            hDst.write("{:<12.6}".format(end-start))


class TestDictionary (unittest.TestCase):
    "Test du correcteur orthographique"








|







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
def timeblock (label, hDst=None):
    "performance counter (contextmanager)"
    start = time.perf_counter()
    try:
        yield
    finally:
        end = time.perf_counter()
        print('{:<20} : {}'.format(label, end - start))
        if hDst:
            hDst.write("{:<12.6}".format(end-start))


class TestDictionary (unittest.TestCase):
    "Test du correcteur orthographique"

47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
            self.assertTrue(self.oDic.isValid(sWord), sWord)

    def test_isvalid_failed (self):
        for sWord in ["BranchE", "BRanche", "BRAnCHE", "émilie", "éMILIE", "émiLie"]:
            self.assertFalse(self.oDic.isValid(sWord), sWord)

    def test_suggest (self):
        for sWord in ["déelirranttesss", "vallidasion", "Emilie", "exibission"]:
            with timeblock(sWord):
                self.assertNotEqual(0, self.oDic.suggest(sWord))


class TestConjugation (unittest.TestCase):
    "Tests des conjugaisons"








|







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
            self.assertTrue(self.oDic.isValid(sWord), sWord)

    def test_isvalid_failed (self):
        for sWord in ["BranchE", "BRanche", "BRAnCHE", "émilie", "éMILIE", "émiLie"]:
            self.assertFalse(self.oDic.isValid(sWord), sWord)

    def test_suggest (self):
        for sWord in ["déelirranttesss", "vallidasion", "Emilie", "exibission", "ditirembique", "jai", "email"]:
            with timeblock(sWord):
                self.assertNotEqual(0, self.oDic.suggest(sWord))


class TestConjugation (unittest.TestCase):
    "Tests des conjugaisons"