def test_get_config_path(self, mocked_pathmapper_fileops): """ Ensure Pathmapper.get_config_path properly delegates to fileops """ mocked_pathmapper_fileops.join_path.return_value = 'hello' self.assertEqual(PathMapper.get_config_path(), 'hello') mocked_pathmapper_fileops.join_path.assert_called_with(PathMapper._rootPath, PathMapper.CONFIG_DIR)
def load_config_file(path=None): """ Loads the config file into the global config variable Keyword Arguments: path: str - The path to load the config from (default: conf/packages.json) """ if path is None: path = fileops.join_path(PathMapper.get_config_path(), CONFIGURATION_FILE) global config config = fileops.get_json_dict(path)
def get_variables_filepath(cls): """ Gets the filepath of the variables file based on a given path mapper """ return fileops.join_path(PathMapper.get_config_path(), Variables.VARIABLES_FILE)
def get_definitions_filepath(cls): """ Gets the filepath of the definitions file based on the path mapper """ return fileops.join_path(PathMapper.get_config_path(), Definitions.DEFINITIONS_FILE)
def get_languages_filepath(cls): """ Gets the filepath of the languages file based on the path mapper """ return fileops.join_path(PathMapper.get_config_path(), Languages.LANGUAGES_FILE)