- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
Latest commit
29 lines (26 loc) · 830 Bytes
/
Copy pathtest.py
File metadata and controls
29 lines (26 loc) · 830 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
27
28
29
fromtools.test_utilimport*
fromsysimportargv
importos
defhelp():
print("Expected args: python test.py (name_of_file.pylambda | name_of_folder) [--err]")
defmain():
iflen(argv) <2:
help()
return
ifos.path.isdir(argv[1]):
forfilenameinos.listdir(argv[1]):
filepath=f"{argv[1]}/{filename}"
ifos.path.isdir(filepath):
continue
ifnottest_file(filepath):
print(f"Failure in file {filename}")
return
print(f"{filepath} run successfully")
print(f"Tests run successfully on directory {argv[1]}")
return
ifnottest_file(argv[1]):
print(f"Failure in file {argv[1]}")
else:
print(f"{argv[1]} run successfully")
if__name__=="__main__":
main()