tests.list_langs_test.test_langs()   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 4
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
nop 1
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