()
| 7 | |
| 8 | |
| 9 | def test_visualization(): |
| 10 | def fn(): |
| 11 | pass |
| 12 | |
| 13 | job = Job() |
| 14 | a = job.function(fn, name="a") |
| 15 | b1 = job.function(fn, name="b1", deps=[a]) |
| 16 | b2 = job.function(fn, name="b2", deps=[a]) |
| 17 | c1 = job.function(fn, name="c1", deps=[b1]) |
| 18 | c2 = job.function(fn, name="c2", deps=[b2]) |
| 19 | job.function(fn, name="d", deps=[c1, c2]) |
| 20 | |
| 21 | with NamedTemporaryFile() as f: |
| 22 | visualize_job(job, f.name) |
| 23 | check_file_contents( |
| 24 | f.name, |
| 25 | """digraph job { |
| 26 | a; |
| 27 | b1; |
| 28 | a -> b1; |
| 29 | b2; |
| 30 | a -> b2; |
| 31 | c1; |
| 32 | b1 -> c1; |
| 33 | c2; |
| 34 | b2 -> c2; |
| 35 | d; |
| 36 | c1 -> d; |
| 37 | c2 -> d; |
| 38 | } |
| 39 | """, |
| 40 | ) |
nothing calls this directly
no test coverage detected