@@ -226,7 +226,7 @@ def test_cli_fremor_run_case2(cli_sosv2_nc_file, tmp_path):
226226 "--grid_label" , "gr" ,
227227 "--grid_desc" , "FOO_BAR_PLACEHOLD" ,
228228 "--nom_res" , "10000 km" ] )
229- assert result .exit_code ! = 0
229+ assert result .exit_code = = 0
230230
231231
232232def test_cli_fremor_run_cmip7_case1 (cli_sos_nc_file , tmp_path ): # pylint: disable=redefined-outer-name
@@ -270,7 +270,7 @@ def test_cli_fremor_run_cmip7_case2(cli_sosv2_nc_file, tmp_path):
270270 "--grid_label" , "g99" ,
271271 "--grid_desc" , "FOO_BAR_PLACEHOLD" ,
272272 "--nom_res" , "10000 km" ] )
273- assert result .exit_code ! = 0
273+ assert result .exit_code = = 0
274274
275275
276276def test_cli_fremor_run_case3 (cli_mapped_nc_file , tmp_path ):
@@ -501,9 +501,12 @@ def test_cli_fremor_varlist_no_table_filter(cli_sos_nc_file, cli_sosv2_nc_file,
501501 assert len (var_list ) == 3
502502
503503
504- def test_cli_fremor_varlist_cmip6_table_filter (cli_sos_nc_file , cli_sosv2_nc_file , tmp_path ): # pylint: disable=redefined-outer-name
505- """fremor varlist — with CMIP6 Omon MIP table filter.
506- Only sos should survive; sosV2 is not in the CMIP6 Omon table."""
504+ def test_cli_fremor_varlist_cmip6_table_filter (cli_sos_nc_file , cli_sosv2_nc_file , cli_mapped_nc_file , tmp_path ):
505+ """
506+ fremor varlist — with CMIP6 Omon MIP table filter.
507+ sos is a MIP variable and gets self-mapped; sosV2 and sea_sfc_salinity are
508+ not MIP variable names and get empty string values.
509+ """
507510 output_varlist = tmp_path / 'test_varlist_cmip6_filter.json'
508511 assert Path (cli_sos_nc_file ).parent == Path (cli_sosv2_nc_file ).parent , 'something wrong with input nc files'
509512
@@ -520,13 +523,20 @@ def test_cli_fremor_varlist_cmip6_table_filter(cli_sos_nc_file, cli_sosv2_nc_fil
520523 with open (output_varlist , 'r' , encoding = 'utf-8' ) as f :
521524 var_list = json .load (f )
522525
523- assert 'sos' in var_list , 'sos should be in the CMIP6-filtered list'
524- assert 'sosV2' not in var_list , 'sosV2 should NOT be in the CMIP6-filtered list'
526+ assert var_list .get ('sos' ) == 'sos' , 'sos should be self-mapped as a MIP variable'
527+ assert 'sosV2' in var_list , 'sosV2 should be included'
528+ assert var_list ['sosV2' ] == '' , 'sosV2 should have empty string value (not a MIP variable name)'
529+ assert 'sea_sfc_salinity' in var_list , 'sea_sfc_salinity should be included'
530+ assert var_list ['sea_sfc_salinity' ] == '' , 'sea_sfc_salinity should have empty string value'
525531
526532
527- def test_cli_fremor_varlist_cmip7_table_filter (cli_sos_nc_file , cli_sosv2_nc_file , tmp_path ): # pylint: disable=redefined-outer-name
528- """fremor varlist — with CMIP7 ocean MIP table filter.
529- sos should survive (sos_tavg-u-hxy-sea splits to sos); sosV2 should not."""
533+ def test_cli_fremor_varlist_cmip7_table_filter (cli_sos_nc_file , cli_sosv2_nc_file , cli_mapped_nc_file , tmp_path ):
534+ """
535+ fremor varlist — with CMIP7 ocean MIP table filter.
536+ sos is a MIP variable (sos_tavg-u-hxy-sea splits to sos) and gets self-mapped;
537+ sosV2 and sea_sfc_salinity are not and get empty string values.
538+ """
539+
530540 output_varlist = tmp_path / 'test_varlist_cmip7_filter.json'
531541 assert Path (cli_sos_nc_file ).parent == Path (cli_sosv2_nc_file ).parent , 'something wrong with input nc files'
532542
@@ -543,8 +553,11 @@ def test_cli_fremor_varlist_cmip7_table_filter(cli_sos_nc_file, cli_sosv2_nc_fil
543553 with open (output_varlist , 'r' , encoding = 'utf-8' ) as f :
544554 var_list = json .load (f )
545555
546- assert 'sos' in var_list , 'sos should be in the CMIP7-filtered list'
547- assert 'sosV2' not in var_list , 'sosV2 should NOT be in the CMIP7-filtered list'
556+ assert var_list .get ('sos' ) == 'sos' , 'sos should be self-mapped as a MIP variable'
557+ assert 'sosV2' in var_list , 'sosV2 should be included'
558+ assert var_list ['sosV2' ] == '' , 'sosV2 should have empty string value (not a MIP variable name)'
559+ assert 'sea_sfc_salinity' in var_list , 'sea_sfc_salinity should be included'
560+ assert var_list ['sea_sfc_salinity' ] == '' , 'sea_sfc_salinity should have empty string value'
548561
549562
550563# ── fremor init ───────────────────────────────────────────────────────────
0 commit comments