From bf3a53b4bff3602408beff9ac7837ecbcad258e9 Mon Sep 17 00:00:00 2001 From: Parag Nemade Date: Fri, 2 Aug 2024 15:59:27 +0530 Subject: [PATCH] Resolves:RHEL-52492 - Add conditional for RHEL for using hunspell directory Add tmt CI tests --- .fmf/version | 1 + hunspell-oc.spec | 9 +++++++-- plans/hunspell-oc.fmf | 5 +++++ tests/test_dic_availability.fmf | 6 ++++++ tests/test_dic_availability.py | 10 ++++++++++ 5 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 .fmf/version create mode 100644 plans/hunspell-oc.fmf create mode 100644 tests/test_dic_availability.fmf create mode 100644 tests/test_dic_availability.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-oc.spec b/hunspell-oc.spec index 757ff17..20ece35 100644 --- a/hunspell-oc.spec +++ b/hunspell-oc.spec @@ -1,12 +1,13 @@ -%if 0%{?fedora} > 35 +%if 0%{?fedora} >= 36 || 0%{?rhel} > 9 %global dict_dirname hunspell %else %global dict_dirname myspell %endif + Name: hunspell-oc Summary: Occitan hunspell dictionaries Version: 1.5 -Release: 4%{?dist} +Release: 5%{?dist} Source: https://addons.mozilla.org/firefox/downloads/file/4085695/diccionari_occitan_lengadocian-%{version}.xpi URL: https://addons.mozilla.org/en-US/firefox/addon/diccionari-occitan-lengadocian/ # https://www.mozilla.org/en-US/MPL/2.0/combining-mpl-and-gpl/ @@ -35,6 +36,10 @@ cp -p dictionaries/oc_FR.aff dictionaries/oc_FR.dic $RPM_BUILD_ROOT/%{_datadir}/ %{_datadir}/%{dict_dirname}/* %changelog +* Fri Aug 02 2024 Parag Nemade - 1.5-5 +- Resolves:RHEL-52493 - Add conditional for RHEL for using hunspell directory +- Add tmt CI tests + * Mon Jun 24 2024 Troy Dawson - 1.5-4 - Bump release for June 2024 mass rebuild diff --git a/plans/hunspell-oc.fmf b/plans/hunspell-oc.fmf new file mode 100644 index 0000000..c1627f9 --- /dev/null +++ b/plans/hunspell-oc.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..0a8c788 --- /dev/null +++ b/tests/test_dic_availability.fmf @@ -0,0 +1,6 @@ +require: +- python3-enchant +- hunspell-oc +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..3a9bd5d --- /dev/null +++ b/tests/test_dic_availability.py @@ -0,0 +1,10 @@ +#!/usr/bin/python3 + +import enchant + +lang = "oc_FR" +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")