Пример #1
0
 def test_buildnmlOpts_bgcVic(self):
     """Test determine_buildnml_opts with bgc_mode='bgc' and vic on: should fail"""
     with self.assertRaisesRegex(
             SystemExit,
             "setting vichydro to 'on' is only compatible with bgc_mode of 'sp'"
     ):
         _ = determine_bldnml_opts(bgc_mode='bgc',
                                   crop='off',
                                   vichydro='on')
Пример #2
0
 def test_buildnmlOpts_spVic(self):
     """Test determine_buildnml_opts with bgc_mode='sp' and vic on"""
     bldnml_opts = determine_bldnml_opts(bgc_mode='sp',
                                         crop='off',
                                         vichydro='on')
     self.assertRegex(bldnml_opts, r'^ *-bgc sp +-vichydro *$')
Пример #3
0
 def test_buildnmlOpts_bgcCrop(self):
     """Test determine_buildnml_opts with bgc_mode='bgc' and crop on"""
     bldnml_opts = determine_bldnml_opts(bgc_mode='bgc',
                                         crop='on',
                                         vichydro='off')
     self.assertRegex(bldnml_opts, r'^ *-bgc bgc +-crop *$')
Пример #4
0
 def test_buildnmlOpts_spCrop_fails(self):
     """Test determine_buildnml_opts with bgc_mode='sp' and crop on: should fail"""
     with self.assertRaisesRegex(
             SystemExit,
             "setting crop to 'on' is only compatible with bgc_mode"):
         _ = determine_bldnml_opts(bgc_mode='sp', crop='on', vichydro='off')
Пример #5
0
 def test_buildnmlOpts_fates(self):
     """Test determine_buildnml_opts with bgc_mode='fates'"""
     bldnml_opts = determine_bldnml_opts(bgc_mode='fates',
                                         crop='off',
                                         vichydro='off')
     self.assertRegex(bldnml_opts, r'^ *-bgc fates +-no-megan *$')