| Total Complexity | 3 |
| Total Lines | 18 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | # -*- coding: utf-8 -*- |
||
| 2 | from dvnv.dvnv import list_langs |
||
| 3 | |||
| 4 | |||
| 5 | def test_no_langs(tmp_path): |
||
| 6 | # tests searching an empty dir |
||
| 7 | assert list_langs(tmp_path) == [] |
||
| 8 | |||
| 9 | # tests searching a dir that doesn't exist |
||
| 10 | scripts_dir = tmp_path / "scripts" |
||
| 11 | assert list_langs(scripts_dir) is None |
||
| 12 | |||
| 13 | |||
| 14 | def test_langs(tmp_path): |
||
| 15 | for lang in ("all", "python", "vim"): |
||
| 16 | (tmp_path / lang).mkdir() |
||
| 17 | assert list_langs(tmp_path) == ["all", "python", "vim"] |
||
| 18 |