| Conditions | 6 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | from uuid import uuid1 |
||
| 8 | def test_make_dotfile(tmpdir): |
||
| 9 | uid = uuid1() |
||
| 10 | dirname = '{}'.format(uid) |
||
| 11 | tmp = tmpdir.mkdir(dirname) |
||
| 12 | for i in range(10): |
||
| 13 | tmp.join('{}.txt'.format(i)).write('{}'.format(i)) |
||
| 14 | data = filetree_digraph.make_dotfile(tmp.strpath) |
||
| 15 | # Ensure wrapping lines are proper digraph format. |
||
| 16 | assert data.startswith('digraph {\n') |
||
| 17 | assert data.endswith('\n}\n') |
||
| 18 | lines = data.split('\n') |
||
| 19 | # Ensure each line has the right dotfile format. |
||
| 20 | for i, line in enumerate(lines[1:len(lines) - 2]): |
||
| 21 | assert line == '\t"{0}" -> "{1}.txt";'.format(uid, i) |
||
| 22 | |||
| 27 |