| @@ -34,18 +34,14 @@ class TestConfigLoader(unittest.TestCase): | |||||
| test_arg = ConfigSection() | test_arg = ConfigSection() | ||||
| ConfigLoader("config", "").load_config(os.path.join("./test/loader", "config"), {"test": test_arg}) | 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") | raise AttributeError("ERROR") | ||||
| for sec in test_arg.__dict__.keys(): | 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") | raise AttributeError("ERROR") | ||||
| try: | try: | ||||