Coverage for test_cli.py: 100%

1 from edictor.cli import main

2 import multiprocessing

3 import time

4 import os

5 import tempfile

6

7

8 def test_server():

9 p = multiprocessing.Process(target=main, args=('server', '--no-window'))

10 p.start()

11 time.sleep(1)

12 p.kill()

13

14

15 def test_fetch():

16

17 with tempfile.TemporaryDirectory() as t:

18 os.system("edictor fetch --dataset=sumerian --name=" + t +

19 "/dummy.tsv")

20

21

22 def test_wordlist():

23 with tempfile.TemporaryDirectory() as t:

24 os.chdir(t)

25 os.system("git clone https://github.com/lexibank/allenbai")

26 os.system("edictor wordlist --dataset=allenbai/cldf/cldf-metadata.json --name=allenbai")

27 assert os.path.exists("allenbai.tsv")

28 os.chdir("..")

29

30

31 def test_main():

32 os.system("edictor")

33 os.system("edictor --help")