def test_core_location_retrieval(self): """ Ensure we can retrieve the core location for localize and unlocalized cores. """ config_root = self._create_pipeline_configuration( "localized_core" ) self.assertEqual( pipelineconfig_utils.get_core_python_path_for_config(config_root), os.path.join(config_root, "install", "core", "python") ) self.assertEqual( pipelineconfig_utils.get_core_path_for_config(config_root), config_root ) unlocalized_core_root = self._create_studio_core("unlocalized_core") config_root = self._create_pipeline_configuration( "config_without_core", core_location=unlocalized_core_root ) self.assertEqual( pipelineconfig_utils.get_core_python_path_for_config(config_root), os.path.join(unlocalized_core_root, "install", "core", "python") ) self.assertEqual( pipelineconfig_utils.get_core_path_for_config(config_root), unlocalized_core_root )
def test_missing_core_location_file(self): """ Ensure we detect missing core location file. """ config_root = self._create_unlocalized_pipeline_configuration("missing_core_location_file") self.assertIsNone(pipelineconfig_utils.get_core_path_for_config(config_root), None) with self.assertRaisesRegexp( TankFileDoesNotExistError, "without a localized core is missing a core" ): pipelineconfig_utils.get_python_interpreter_for_config(config_root)