File: spellcheck_test.py

package info (click to toggle)
git-cola 4.13.0-1
  • links: PTS
  • area: main
  • in suites: sid
  • size: 6,480 kB
  • sloc: python: 36,938; sh: 304; makefile: 223; xml: 100; tcl: 62
file content (21 lines) | stat: -rw-r--r-- 474 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from cola import compat
from cola import spellcheck

from . import helper


def test_spellcheck_generator():
    check = spellcheck.NorvigSpellCheck()
    assert_spellcheck(check)


def test_spellcheck_unicode():
    path = helper.fixture('unicode.txt')
    check = spellcheck.NorvigSpellCheck(words=path)
    assert_spellcheck(check)


def assert_spellcheck(check):
    for word in check.read():
        assert word is not None
        assert isinstance(word, compat.ustr)