-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathconfigs_test.py
More file actions
33 lines (28 loc) · 837 Bytes
/
configs_test.py
File metadata and controls
33 lines (28 loc) · 837 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
30
31
32
33
import unittest
import os
import configs
import tools
class TestConfigs(unittest.TestCase):
def test_saveloadconfigs(self):
config = configs.input_ProtoConfig()
savepath = os.path.join(os.getcwd(), 'datasets', 'tmp')
try:
os.mkdir(savepath)
except FileExistsError:
pass
print(config.__dict__)
tools.save_config(config, savepath)
tools.load_config(savepath)
def test_configupdate(self):
config = configs.input_ProtoConfig()
savepath = os.path.join(os.getcwd(), 'datasets', 'tmp')
try:
os.mkdir(savepath)
except FileExistsError:
pass
print(config.__dict__)
tools.save_config(config, savepath)
config2 = tools.load_config(savepath)
config2.update(config)
if __name__ == '__main__':
unittest.main()