-
Notifications
You must be signed in to change notification settings - Fork 2k
/
pyunit_download_all_logs.py
36 lines (26 loc) · 1.1 KB
/
pyunit_download_all_logs.py
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
30
31
32
33
34
35
36
import sys
sys.path.insert(1,"../../")
import h2o
from tests import pyunit_utils
import os
def download_all_logs():
# default
log_location = h2o.download_all_logs()
assert os.path.exists(log_location), "Expected h2o logs to be saved in {0}, but they weren't".format(log_location)
os.remove(log_location)
# dirname and filename
log_location = h2o.download_all_logs(".","h2o_logs.txt")
assert os.path.exists(log_location), "Expected h2o logs to be saved in {0}, but they weren't".format(log_location)
os.remove(log_location)
# dirname
log_location = h2o.download_all_logs(dirname=".")
assert os.path.exists(log_location), "Expected h2o logs to be saved in {0}, but they weren't".format(log_location)
os.remove(log_location)
# filename
log_location = h2o.download_all_logs(filename="h2o_logs.txt")
assert os.path.exists(log_location), "Expected h2o logs to be saved in {0}, but they weren't".format(log_location)
os.remove(log_location)
if __name__ == "__main__":
pyunit_utils.standalone_test(download_all_logs)
else:
download_all_logs()