fre.cmor.tests.test_cmor_helpers_update_calendar module
tests for fre.cmor.cmor_helpers.update_calendar_type
- fre.cmor.tests.test_cmor_helpers_update_calendar.temp_json_file(tmp_path)
Fixture to create a temporary JSON file for testing.
- Args:
tmp_path: pytest’s fixture for temporary directories.
- Returns:
Path to the temporary JSON file.
- fre.cmor.tests.test_cmor_helpers_update_calendar.temp_jsondecodeerr_json_file(tmp_path)
- fre.cmor.tests.test_cmor_helpers_update_calendar.temp_keyerr_json_file(tmp_path)
Fixture to create a temporary JSON file for testing.
- Args:
tmp_path: pytest’s fixture for temporary directories.
- Returns:
Path to the temporary JSON file.
- fre.cmor.tests.test_cmor_helpers_update_calendar.test_update_calendar_type_jsonDNE_raise()
Test error raising when the input experiment json doesn’t exist
- fre.cmor.tests.test_cmor_helpers_update_calendar.test_update_calendar_type_jsondecode_raise(temp_jsondecodeerr_json_file)
Test raising a JSONDecodeError
- fre.cmor.tests.test_cmor_helpers_update_calendar.test_update_calendar_type_keyerror_raise(temp_keyerr_json_file)
Test error raising when the calendar key doesn’t exist
- fre.cmor.tests.test_cmor_helpers_update_calendar.test_update_calendar_type_success(temp_json_file)
Test successful update of ‘grid_label’ and ‘grid’ fields.
- fre.cmor.tests.test_cmor_helpers_update_calendar.test_update_calendar_type_unknown_err()
Test raising an exception not caught by the other ones
- fre.cmor.tests.test_cmor_helpers_update_calendar.test_update_calendar_type_valerr_raise(temp_json_file)
Test error raising when the input calendar is None