From 1c0a4101064f304a0e600ab4bad0d4c7aa0a834e Mon Sep 17 00:00:00 2001 From: Parag Nemade Date: May 19 2019 11:05:37 +0000 Subject: Added CI tests Signed-off-by: Parag Nemade --- diff --git a/tests/scripts/run_tests.sh b/tests/scripts/run_tests.sh new file mode 100644 index 0000000..80d965a --- /dev/null +++ b/tests/scripts/run_tests.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +python3 test_suggest_words.py +python3 test_dic_availability.py diff --git a/tests/scripts/test_dic_availability.py b/tests/scripts/test_dic_availability.py new file mode 100644 index 0000000..158f7fd --- /dev/null +++ b/tests/scripts/test_dic_availability.py @@ -0,0 +1,10 @@ +#!/usr/bin/python3 + +import enchant + +lang = "mai_IN" +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/scripts/test_suggest_words.py b/tests/scripts/test_suggest_words.py new file mode 100644 index 0000000..6c6d4c0 --- /dev/null +++ b/tests/scripts/test_suggest_words.py @@ -0,0 +1,9 @@ +#!/usr/bin/python3 + +import enchant + +wdlst = [ "अखा", "अंक", "मैथ"] +dic = enchant.Dict("mai_IN") +for wd in wdlst: + dic.check(wd) + print("input word = {0}, Suggestions => {1}".format(wd, dic.suggest(wd))) diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..5ffb74a --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,11 @@ +- hosts: localhost + roles: + - role: standard-test-basic + required_packages: + - python3-enchant + tags: + - classic + tests: + - sample: + dir: scripts/ + run: ./run_tests.sh