Merge pull request #898 from NotSqrt/diff-edit-gotoline
[git-cola.git] / test / spellcheck_test.py
blob85cec07b12c05a4223122cca64d0d24ff252efbc
1 #!/usr/bin/env python
2 from __future__ import absolute_import, division, unicode_literals
3 import unittest
5 from cola import compat
6 from cola import spellcheck
8 from . import helper
11 class TestCase(unittest.TestCase):
13 def test_spellcheck_generator(self):
14 check = spellcheck.NorvigSpellCheck()
15 self.assert_spellcheck(check)
17 def test_spellcheck_unicode(self):
18 path = helper.fixture('unicode.txt')
19 check = spellcheck.NorvigSpellCheck(cracklib=path)
20 self.assert_spellcheck(check)
22 def assert_spellcheck(self, check):
23 for word in check.read():
24 self.assertTrue(word is not None)
25 self.assertTrue(isinstance(word, compat.ustr))
28 if __name__ == '__main__':
29 unittest.main()