-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_get_files_info.py
More file actions
26 lines (22 loc) · 857 Bytes
/
test_get_files_info.py
File metadata and controls
26 lines (22 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# import functions.get_files_info
from functions.get_files_info import get_files_info
test1 = get_files_info("calculator", ".")
print(test1)
'''Result for current directory:
- main.py: file_size=719 bytes, is_dir=False
- tests.py: file_size=1331 bytes, is_dir=False
- pkg: file_size=44 bytes, is_dir=True
'''
test2 = get_files_info("calculator", "pkg")
print(test2)
'''Result for 'pkg' directory:
- calculator.py: file_size=1721 bytes, is_dir=False
- render.py: file_size=376 bytes, is_dir=False'''
test3 = get_files_info("calculator", "/bin")
print(test3)
''''Result for '/bin' directory:
Error: Cannot list "/bin" as it is outside the permitted working directory'''
test4 = get_files_info("calculator", "../")
print(test4)
''''Result for '../' directory:
Error: Cannot list "../" as it is outside the permitted working directory'''