Merge pull request #1069 from laerreal/hide_passphrase
[git-cola.git] / test / spellcheck_test.py
blob97fbcffe76465cabb11a6490365c4261db269e77
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):
12 def test_spellcheck_generator(self):
13 check = spellcheck.NorvigSpellCheck()
14 self.assert_spellcheck(check)
16 def test_spellcheck_unicode(self):
17 path = helper.fixture('unicode.txt')
18 check = spellcheck.NorvigSpellCheck(cracklib=path)
19 self.assert_spellcheck(check)
21 def assert_spellcheck(self, check):
22 for word in check.read():
23 self.assertTrue(word is not None)
24 self.assertTrue(isinstance(word, compat.ustr))
27 if __name__ == '__main__':
28 unittest.main()