File: test_spellcheck.py

package info (click to toggle)
python-jtoolkit 0.7.8-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,436 kB
  • ctags: 2,536
  • sloc: python: 15,143; makefile: 20
file content (15 lines) | stat: -rw-r--r-- 551 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from jToolkit import spellcheck

class TestSpellCheck:
    disabled = not spellcheck.have_checker()
    def test_can_check_lang(self):
        assert spellcheck.can_check_lang()
        assert not spellcheck.can_check_lang("unknownlanguage")
        # repeat checks to make sure cache works
        assert spellcheck.can_check_lang()
        assert not spellcheck.can_check_lang("unknownlanguage")

    def test_english_check(self):
        assert not spellcheck.check("perfect spelling", "en")
        assert spellcheck.check("flawd speling", "en")