Exemple #1
0
 def test_CachedMetricModuleFactory(self):
     path = os.path.join(self._metric_loading_script_dir,
                         f"{METRIC_LOADING_SCRIPT_NAME}.py")
     factory = LocalMetricModuleFactory(
         path,
         download_config=self.download_config,
         dynamic_modules_path=self.dynamic_modules_path)
     module_factory_result = factory.get_module()
     for offline_mode in OfflineSimulationMode:
         with offline(offline_mode):
             factory = CachedMetricModuleFactory(
                 METRIC_LOADING_SCRIPT_NAME,
                 dynamic_modules_path=self.dynamic_modules_path,
             )
             module_factory_result = factory.get_module()
             assert importlib.import_module(
                 module_factory_result.module_path) is not None
Exemple #2
0
 def test_LocalMetricModuleFactory(self):
     path = os.path.join(self._metric_loading_script_dir,
                         f"{METRIC_LOADING_SCRIPT_NAME}.py")
     factory = LocalMetricModuleFactory(
         path,
         download_config=self.download_config,
         dynamic_modules_path=self.dynamic_modules_path)
     module_factory_result = factory.get_module()
     assert importlib.import_module(
         module_factory_result.module_path) is not None