Coverage for test_wordlist.py: 100%

1 import tempfile

2 from edictor.wordlist import fetch_wordlist, get_wordlist

3 from pathlib import Path

4 import os

5 import codecs

6

7

8 def test_fetch_wordlist():

9

10 data = fetch_wordlist("ltkkaren")

11 assert data[:2] == "ID"

12

13

14 def test_get_wordlist():

15

16 def prep(wordlist):

17 return wordlist

18

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)

26