tests.list_langs_test   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 10
dl 0
loc 18
rs 10
c 0
b 0
f 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A test_langs() 0 4 2
A test_no_langs() 0 7 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