| Total Complexity | 9 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 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() |