From 144898556ccfac8341a54e862ab7d5ab45dcb9cd Mon Sep 17 00:00:00 2001 From: Parag Nemade Date: May 19 2019 11:06:14 +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..d4d0b28 --- /dev/null +++ b/tests/scripts/test_dic_availability.py @@ -0,0 +1,10 @@ +#!/usr/bin/python3 + +import enchant + +lang = "ne_NP" +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..1915b5d --- /dev/null +++ b/tests/scripts/test_suggest_words.py @@ -0,0 +1,9 @@ +#!/usr/bin/python3 + +import enchant + +wdlst = [ "नमस", "अभि", "यथात"] +dic = enchant.Dict("ne_NP") +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