From 0f47038626ded139737f0dc155b9eb990d0e6e0d Mon Sep 17 00:00:00 2001 From: Parag Nemade Date: Sun, 8 Dec 2024 12:51:32 +0530 Subject: [PATCH] Add tmt CI testcase --- .fmf/version | 1 + plans/hunspell-fo.fmf | 5 +++++ tests/test_dic_availability.fmf | 6 ++++++ tests/test_dic_availability.py | 10 ++++++++++ tests/test_suggest_words.fmf | 6 ++++++ tests/test_suggest_words.py | 9 +++++++++ 6 files changed, 37 insertions(+) create mode 100644 .fmf/version create mode 100644 plans/hunspell-fo.fmf create mode 100644 tests/test_dic_availability.fmf create mode 100644 tests/test_dic_availability.py create mode 100644 tests/test_suggest_words.fmf create mode 100644 tests/test_suggest_words.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/hunspell-fo.fmf b/plans/hunspell-fo.fmf new file mode 100644 index 0000000..c1627f9 --- /dev/null +++ b/plans/hunspell-fo.fmf @@ -0,0 +1,5 @@ +summary: Basic smoke test +discover: + how: fmf +execute: + how: tmt diff --git a/tests/test_dic_availability.fmf b/tests/test_dic_availability.fmf new file mode 100644 index 0000000..73475f0 --- /dev/null +++ b/tests/test_dic_availability.fmf @@ -0,0 +1,6 @@ +require: +- python3-enchant +- hunspell-fo +test: python3 test_dic_availability.py +framework: shell + diff --git a/tests/test_dic_availability.py b/tests/test_dic_availability.py new file mode 100644 index 0000000..72ac507 --- /dev/null +++ b/tests/test_dic_availability.py @@ -0,0 +1,10 @@ +#!/usr/bin/python3 + +import enchant + +lang = "fo_FO" +try: + dic = enchant.request_dict(lang) + print("Dictionary for {0} language is available for use".format(lang)) +except enchant.errors.DictNotFoundError: + print("Dictionary is not installed for use") diff --git a/tests/test_suggest_words.fmf b/tests/test_suggest_words.fmf new file mode 100644 index 0000000..300fb03 --- /dev/null +++ b/tests/test_suggest_words.fmf @@ -0,0 +1,6 @@ +require: +- python3-enchant +- hunspell-fo +test: python3 test_suggest_words.py +framework: shell + diff --git a/tests/test_suggest_words.py b/tests/test_suggest_words.py new file mode 100644 index 0000000..a9af22c --- /dev/null +++ b/tests/test_suggest_words.py @@ -0,0 +1,9 @@ +#!/usr/bin/python3 + +import enchant + +wdlst = [ "Hey" ,"te", "morgun"] +dic = enchant.Dict("fo_FO") +for wd in wdlst: + dic.check(wd) + print("input word = {0}, Suggestions => {1}".format(wd, dic.suggest(wd)))