fremor.tests.test_cmor_yamler_subtool module

tests for fremor.cmor_yamler.cmor_yaml_subtool

Covers direct loading of self-contained CMOR YAML files.

fremor.tests.test_cmor_yamler_subtool.test_cmip6_freq_none_derivation_exception_caught(tmp_path)

KeyError in MIP-table frequency lookup should become ValueError.

fremor.tests.test_cmor_yamler_subtool.test_cmip6_freq_none_derivation_succeeds(tmp_path)

CMIP6 frequency should be derived from the MIP table when omitted.

fremor.tests.test_cmor_yamler_subtool.test_cmip6_freq_none_no_derivation_raises(tmp_path)

ValueError when CMIP6 freq is missing and cannot be derived.

fremor.tests.test_cmor_yamler_subtool.test_cmip7_freq_none_raises(tmp_path)

ValueError when mip_era=CMIP7 and freq is None.

fremor.tests.test_cmor_yamler_subtool.test_cmor_yaml_subtool_dry_run_false(yamler_env)

Full end-to-end run should produce at least one CMORized file.

fremor.tests.test_cmor_yamler_subtool.test_dry_run_prints_cli_call(tmp_path)

dry_run_mode=True with print_cli_call=True should not create outputs.

fremor.tests.test_cmor_yamler_subtool.test_dry_run_prints_python_call(tmp_path)

dry_run_mode=True with print_cli_call=False should not create outputs.

fremor.tests.test_cmor_yamler_subtool.test_exp_json_does_not_exist(tmp_path)

FileNotFoundError when exp_json path does not exist.

fremor.tests.test_cmor_yamler_subtool.test_gridding_dict_has_none_value_raises(tmp_path)

ValueError when a gridding field is None.

fremor.tests.test_cmor_yamler_subtool.test_mip_table_file_does_not_exist(tmp_path)

FileNotFoundError when the derived json_mip_table_config does not exist.

fremor.tests.test_cmor_yamler_subtool.test_outdir_creation_failure_raises_oserror(tmp_path)

OSError when cmorized_outdir creation fails.

fremor.tests.test_cmor_yamler_subtool.test_outdir_creation_when_missing(tmp_path)

Missing cmorized_outdir should be created in dry-run mode.

fremor.tests.test_cmor_yamler_subtool.test_pp_dir_does_not_exist(tmp_path)

FileNotFoundError when pp_dir does not exist.

fremor.tests.test_cmor_yamler_subtool.test_start_stop_calendar_missing_from_yaml(tmp_path)

Missing start/stop/calendar_type keys should log warnings and continue.

fremor.tests.test_cmor_yamler_subtool.test_table_dir_does_not_exist(tmp_path)

FileNotFoundError when cmip_cmor_table_dir does not exist.

fremor.tests.test_cmor_yamler_subtool.test_yamlfile_does_not_exist()

FileNotFoundError when yamlfile path does not exist.

fremor.tests.test_cmor_yamler_subtool.yamler_env(tmp_path)

Set up a temporary pp directory tree and matching CMOR YAML.