From 10ce1cc5405c6eb87c000ee4aa605e35c9c08016 Mon Sep 17 00:00:00 2001 From: Mike FABIAN Date: Mon, 5 Jul 2021 13:47:15 +0200 Subject: [PATCH] Add CI tests --- .fmf/version | 1 + plans/basic.fmf | 5 +++++ tests/main.fmf | 7 +++++++ tests/test_enchant.py | 31 +++++++++++++++++++++++++++++++ 4 files changed, 44 insertions(+) create mode 100644 .fmf/version create mode 100644 plans/basic.fmf create mode 100644 tests/main.fmf create mode 100644 tests/test_enchant.py diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/plans/basic.fmf b/plans/basic.fmf new file mode 100644 index 0000000..c1627f9 --- /dev/null +++ b/plans/basic.fmf @@ -0,0 +1,5 @@ +summary: Basic smoke test +discover: + how: fmf +execute: + how: tmt diff --git a/tests/main.fmf b/tests/main.fmf new file mode 100644 index 0000000..bce47e5 --- /dev/null +++ b/tests/main.fmf @@ -0,0 +1,7 @@ +require: +- python3 +- python3-enchant +- hunspell-en-US +- hunspell-de +test: python3 test_enchant.py -v +framework: shell diff --git a/tests/test_enchant.py b/tests/test_enchant.py new file mode 100644 index 0000000..e8ee2c1 --- /dev/null +++ b/tests/test_enchant.py @@ -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()