Coverage for test_wordlist.py: 100%
18 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-07 06:52 +0200
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-07 06:52 +0200
1import tempfile
2from edictor.wordlist import fetch_wordlist, get_wordlist
3from pathlib import Path
4import os
5import codecs
8def test_fetch_wordlist():
10 data = fetch_wordlist("ltkkaren")
11 assert data[:2] == "ID"
14def test_get_wordlist():
16 def prep(wordlist):
17 return wordlist
19 test_path = Path(__file__).parent.joinpath('data')
20 fn = test_path / "cldf" / "cldf-metadata.json"
21 pp = test_path / "prep.py"
22 with tempfile.TemporaryDirectory() as t:
23 os.chdir(t)
24 get_wordlist(fn, "bai")
25 get_wordlist(fn, "bai", preprocessing=prep, lexibase=True)