fre.cmor.tests.test_cmor_mixer_calendar_integration module

Calendar-type integration tests for cmor_run_subtool

These tests verify that cmor_run_subtool correctly handles the calendar_type parameter:

  • When a calendar_type is provided → update_calendar_type is called.

  • When calendar_type is None → update_calendar_type is NOT called.

Heavy internal work (file globbing, CMORization, outpath updating) is mocked so the tests focus exclusively on the calendar-type routing logic.

fre.cmor.tests.test_cmor_mixer_calendar_integration.exp_config_file(tmp_path)

Minimal CMIP6 experiment configuration JSON (with outpath for update_outpath).

fre.cmor.tests.test_cmor_mixer_calendar_integration.fake_nc_filenames(tmp_path)

Return a list of fake NetCDF filenames that glob would find.

fre.cmor.tests.test_cmor_mixer_calendar_integration.table_config_file(tmp_path)

MIP-table JSON with two stub variable entries.

fre.cmor.tests.test_cmor_mixer_calendar_integration.test_cmor_run_no_cal_type(mock_glob, mock_cmorize, mock_update_cal, exp_config_file, var_list_file, table_config_file, fake_nc_filenames, tmp_path)

When calendar_type is None (default), update_calendar_type must NOT be called.

fre.cmor.tests.test_cmor_mixer_calendar_integration.test_cmor_run_w_cal_type(mock_glob, mock_cmorize, mock_update_cal, exp_config_file, var_list_file, table_config_file, fake_nc_filenames, tmp_path)

When calendar_type is provided, update_calendar_type must be called.

fre.cmor.tests.test_cmor_mixer_calendar_integration.var_list_file(tmp_path)

Variable-list JSON mapping local names to target names.