From aa0636f65a958e5808f175131b855a21b5742a8f Mon Sep 17 00:00:00 2001 From: "FC (Fay) Stegerman" Date: Fri, 15 Dec 2023 00:28:14 +0100 Subject: [PATCH] WIP --- Makefile | 2 ++ jiten/app.py | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b912fd8..8bac800 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,7 @@ test: all test-js $(PYTHON) -m jiten.kana $(VERBOSE) --doctest $(PYTHON) -m jiten.kanji $(VERBOSE) --doctest $(PYTHON) -m jiten.misc $(VERBOSE) --doctest + ! test -e nonfree-data/pitch || \ $(PYTHON) -m jiten.pitch $(VERBOSE) --doctest $(PYTHON) -m jiten.sentences $(VERBOSE) --doctest @@ -47,6 +48,7 @@ coverage: tmp-html $(PYCOV) -a -m jiten.kana --doctest $(PYCOV) -a -m jiten.kanji --doctest $(PYCOV) -a -m jiten.misc --doctest + ! test -e nonfree-data/pitch || \ $(PYCOV) -a -m jiten.pitch --doctest $(PYCOV) -a -m jiten.sentences --doctest $(PYTHON) -mcoverage html diff --git a/jiten/app.py b/jiten/app.py index f30a1d8..0d23cff 100644 --- a/jiten/app.py +++ b/jiten/app.py @@ -18,8 +18,9 @@ Web interface. ->>> import re +>>> import os, re +>>> have_nonfree = os.path.exists("nonfree-data/pitch") >>> app.testing = True >>> client = app.test_client() @@ -43,9 +44,9 @@ >>> d = get("/jmdict?query=kitten&word=yes") 200 OK ->>> "こꜛねꜜこ" in d +>>> "こꜛねꜜこ" in d or not have_nonfree True ->>> "koꜛneꜜko" in d +>>> "koꜛneꜜko" in d or not have_nonfree True >>> "kitten" in d True