Browse Source

clean up codes

tags/v0.1.0
xuyige 6 years ago
parent
commit
58ccb6576f
1 changed files with 4 additions and 8 deletions
  1. +4
    -8
      test/loader/test_loader.py

+ 4
- 8
test/loader/test_loader.py View File

@@ -34,18 +34,14 @@ class TestConfigLoader(unittest.TestCase):

test_arg = ConfigSection()
ConfigLoader("config", "").load_config(os.path.join("./test/loader", "config"), {"test": test_arg})
#ConfigLoader("config", "").load_config("/home/ygxu/github/fastNLP_testing/fastNLP/test/loader/config",
# {"test": test_arg})
section = read_section_from_config(os.path.join("./test/loader", "config"), "test")

#dict = read_section_from_config("/home/ygxu/github/fastNLP_testing/fastNLP/test/loader/config", "test")
dict = read_section_from_config(os.path.join("./test/loader", "config"), "test")

for sec in dict:
if (sec not in test_arg) or (dict[sec] != test_arg[sec]):
for sec in section:
if (sec not in test_arg) or (section[sec] != test_arg[sec]):
raise AttributeError("ERROR")

for sec in test_arg.__dict__.keys():
if (sec not in dict) or (dict[sec] != test_arg[sec]):
if (sec not in section) or (section[sec] != test_arg[sec]):
raise AttributeError("ERROR")

try:


Loading…
Cancel
Save