From 6e08e67ab3d95a31033581ca8142cda3c63c5b0d Mon Sep 17 00:00:00 2001 From: Parag Nemade Date: Mon, 12 Aug 2024 19:38:08 +0530 Subject: [PATCH] Resolves:RHEL-52512 - Add conditional for RHEL for using hunspell directory Add tmt CI tests --- .fmf/version | 1 + hunspell-sr.spec | 8 ++++++-- plans/hunspell-sr.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 +++++++++ 7 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 .fmf/version create mode 100644 plans/hunspell-sr.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/hunspell-sr.spec b/hunspell-sr.spec index dff40ca..f2bdaca 100644 --- a/hunspell-sr.spec +++ b/hunspell-sr.spec @@ -1,4 +1,4 @@ -%if 0%{?fedora} > 35 +%if 0%{?fedora} >= 36 || 0%{?rhel} > 9 %global dict_dirname hunspell %else %global dict_dirname myspell @@ -7,7 +7,7 @@ Name: hunspell-sr Summary: Serbian hunspell dictionaries %global upstreamid 20130330 Version: 0.%{upstreamid} -Release: 26%{?dist} +Release: 27%{?dist} Source: https://downloads.sourceforge.net/project/aoo-extensions/1572/10/dict-sr.oxt URL: http://extensions.services.openoffice.org/project/dict-sr License: LGPL-3.0-only @@ -77,6 +77,10 @@ popd %{_datadir}/hyphen/* %changelog +* Mon Aug 12 2024 Parag Nemade - 0.20130330-27 +- Resolves:RHEL-52512 - Add conditional for RHEL for using hunspell directory +- Add tmt CI tests + * Mon Jun 24 2024 Troy Dawson - 0.20130330-26 - Bump release for June 2024 mass rebuild diff --git a/plans/hunspell-sr.fmf b/plans/hunspell-sr.fmf new file mode 100644 index 0000000..c1627f9 --- /dev/null +++ b/plans/hunspell-sr.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..9bad7b5 --- /dev/null +++ b/tests/test_dic_availability.fmf @@ -0,0 +1,6 @@ +require: +- python3-enchant +- hunspell-sr +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..872a251 --- /dev/null +++ b/tests/test_dic_availability.py @@ -0,0 +1,10 @@ +#!/usr/bin/python3 + +import enchant + +lang = "sr_YU" +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..c380132 --- /dev/null +++ b/tests/test_suggest_words.fmf @@ -0,0 +1,6 @@ +require: +- python3-enchant +- hunspell-sr +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..53f21d1 --- /dev/null +++ b/tests/test_suggest_words.py @@ -0,0 +1,9 @@ +#!/usr/bin/python3 + +import enchant + +wdlst = [ "здрав", "чај", "јутро"] +dic = enchant.Dict("sr_YU") +for wd in wdlst: + dic.check(wd) + print("input word = {0}, Suggestions => {1}".format(wd, dic.suggest(wd)))