Add CI tests

This commit is contained in:
Mike FABIAN 2021-07-05 13:47:15 +02:00
parent 4f9a7e926e
commit 10ce1cc540
4 changed files with 44 additions and 0 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

5
plans/basic.fmf Normal file
View File

@ -0,0 +1,5 @@
summary: Basic smoke test
discover:
how: fmf
execute:
how: tmt

7
tests/main.fmf Normal file
View File

@ -0,0 +1,7 @@
require:
- python3
- python3-enchant
- hunspell-en-US
- hunspell-de
test: python3 test_enchant.py -v
framework: shell

31
tests/test_enchant.py Normal file
View File

@ -0,0 +1,31 @@
import unittest
import sys
import enchant
class TestEnchant(unittest.TestCase):
def test_dummy(self):
self.assertEqual(True, True)
@unittest.expectedFailure
def test_expected_failure(self):
self.assertEqual(False, True)
def test_en_US(self):
d = enchant.Dict('en_US')
self.assertEqual(d.check('enchant'), True)
self.assertEqual(d.check('enchnt'), False)
self.assertEqual(
d.suggest('enchnt'),
['enchant', 'entrench', 'tench'])
def test_de_DE(self):
d = enchant.Dict('de_DE')
self.assertEqual(d.check('Alpenglühen'), True)
self.assertEqual(d.check('Alpengluhen'), False)
self.assertEqual(
d.suggest('Alpengluhen'),
['Alpenglühen', 'Alpengluten', 'Alpenländischen'])
if __name__ == "__main__":
unittest.main()