Exemple #1
0
 def test_get_value_ref(self, tmp_path):
     filename = 'user_parameters.yml'
     p, f = create_temporary_file(tmp_path, filename)
     write_parameter_to_file(f, 'model_output__out_dir',
                             tmp_path / 'out_dir')
     f.close()
     delta = BmiDelta()
     delta.initialize(p)
     with pytest.warns(DeprecationWarning):
         assert delta.get_value_ref(
             'sea_water_surface__elevation') is delta.get_value_ptr(
                 'sea_water_surface__elevation')
Exemple #2
0
 def test_get_value_ptr(self, tmp_path):
     filename = 'user_parameters.yml'
     p, f = create_temporary_file(tmp_path, filename)
     write_parameter_to_file(f, 'model_output__out_dir',
                             tmp_path / 'out_dir')
     f.close()
     delta = BmiDelta()
     delta.initialize(p)
     assert delta.get_value_ptr(
         'sea_water_surface__elevation'
     ) is delta._values['sea_water_surface__elevation']
     assert delta.get_value_ptr(
         'sea_water__depth') is delta._values['sea_water__depth']
     assert delta.get_value_ptr(
         'sea_bottom_surface__elevation'
     ) is delta._values['sea_bottom_surface__elevation']
     assert delta.get_value_ptr(
         'sea_water_surface__elevation') is delta._delta.stage
     assert delta.get_value_ptr('sea_water__depth') is delta._delta.depth
     assert delta.get_value_ptr(
         'sea_bottom_surface__elevation') is delta._delta.eta