Coverage for tests/test_cfl.py: 81.25%

Shortcuts on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

16 statements  

1import lcdoc.call_flows.call_flow_logging as cfl pytest

2from lcdoc.tools import dirname as d pytest

3from lcdoc.tools import os, project, write_file pytest

4 

5# we nail this - since in actual lp we have the mkdocs.yml, since then running under mkdocs: 

6project.root({'docs_dir': d(d(__file__)) + '/docs'}) pytest

7assert 'tests' in os.listdir(project.root()) pytest

8 

9 

10def say_hello(name): pytest

11 print('hi ', name) 

12 return ['greeted', name] 

13 

14 

15def test_one(): pytest

16 d = project.root() + '/build/autodocs/tests/' pytest|tests.test_cfl.test_one

17 os.makedirs(d, exist_ok=True) pytest|tests.test_cfl.test_one

18 d += '/testlog.md' pytest|tests.test_cfl.test_one

19 write_file(d, '') pytest|tests.test_cfl.test_one

20 

21 @cfl.document(trace=say_hello, dest=d) pytest|tests.test_cfl.test_one

22 def runit(): 

23 res = say_hello('joe') 

24 

25 runit() pytest|tests.test_cfl.test_one