Passed
Branch DICOMAnonimization (c59297)
by Yang
02:05
created

test_file_ops.test_recursive_load()   A

Complexity

Conditions 2

Size

Total Lines 4
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
import os
2
from file_operation import recursive_list_files, get_file_name
3
4
5
def test_recursive_load():
6
    file_list = recursive_list_files(os.getcwd())
7
    print(file_list)
8
    assert len(file_list) > 1000
9
10
def test_get_file_name():
11
    path1 = "C:\Windows\Sysmte32\Crapware"
12
    path2 = "C:\Windows\Sysmte32\Crapware\\"
13
    path3 = "C:\Windows\Sysmte32\Crapware\Shittyexe.exe"
14
    path4 = "/bin/dir/var/mnt/usr/queenbee"
15
    path5 = "/bin/dir/var/mnt/usr/queenbee/"
16
    path6 = "/bin/dir/var/mnt/usr/queenbee/notmyproblem.tif"
17
18
    assert get_file_name(path1) == "Crapware"
19
    assert get_file_name(path2) == ''
20
    assert get_file_name(path3) == "Shittyexe.exe"
21
    assert get_file_name(path4) == "queenbee"
22
    assert get_file_name(path5) == ''
23
    assert get_file_name(path6) == "notmyproblem.tif"
24
25
if __name__ == '__main__':
26
    test_recursive_load()
27
    test_get_file_name()