Exemplo n.º 1
0
 def test_config_repository_load(self, hydra_restore_singletons: Any,
                                 path: str) -> None:
     Plugins.instance()  # initializes
     config_search_path = create_config_search_path(path)
     repo = ConfigRepository(config_search_path=config_search_path)
     ret = repo.load_config(config_path="dataset/imagenet.yaml")
     assert ret is not None
     assert ret.config == {"name": "imagenet", "path": "/datasets/imagenet"}
     assert repo.load_config(config_path="not_found.yaml") is None
Exemplo n.º 2
0
 def test_config_repository_load(self, path: str) -> None:
     config_search_path = create_config_search_path(path)
     repo = ConfigRepository(config_search_path=config_search_path)
     ret = repo.load_config(config_path="dataset/imagenet.yaml")
     assert ret is not None
     assert ret.config == {
         "dataset": {
             "name": "imagenet",
             "path": "/datasets/imagenet"
         }
     }
     assert repo.load_config(config_path="not_found.yaml") is None
Exemplo n.º 3
0
 def test_config_repository_list(
     self,
     hydra_restore_singletons: Any,
     path: str,
     config_path: str,
     expected: List[InputDefault],
 ) -> None:
     Plugins.instance()
     config_search_path = create_config_search_path(path)
     repo = ConfigRepository(config_search_path=config_search_path)
     ret = repo.load_config(config_path)
     assert ret is not None
     assert ret.defaults_list == expected