@@ -417,3 +417,42 @@ def input_for_heat_prices(params) -> GeophiresInputParameters:
417
417
418
418
self .assertEqual (cashflow_escalating [2 ][4 ], 1.5 )
419
419
self .assertEqual (cashflow_escalating [- 1 ][4 ], 3.0 )
420
+
421
+ def test_disabled_currency_conversion_exceptions (self ):
422
+ """
423
+ TODO: this test can be removed once https://github.com/NREL/GEOPHIRES-X/issues/236 is addressed. (Its purpose
424
+ is to ensure currency conversion failure behavior is as expected in the interim.)
425
+ """
426
+
427
+ with self .assertRaises (RuntimeError ) as re_ec :
428
+ GeophiresXClient ().get_geophires_result (
429
+ GeophiresInputParameters (
430
+ from_file_path = self ._get_test_file_path (Path ('examples/example1_outputunits.txt' )),
431
+ params = {'Units:Exploration cost,MEUR' : 'MEUR' },
432
+ )
433
+ )
434
+
435
+ e_msg = str (re_ec .exception )
436
+
437
+ self .assertIn (
438
+ 'Error: GEOPHIRES failed to convert your currency for Exploration cost to something it understands.' , e_msg
439
+ )
440
+ self .assertIn ('You gave MEUR' , e_msg )
441
+ self .assertIn ('https://github.com/NREL/GEOPHIRES-X/issues/236' , e_msg )
442
+
443
+ with self .assertRaises (RuntimeError ) as re_omwc :
444
+ GeophiresXClient ().get_geophires_result (
445
+ GeophiresInputParameters (
446
+ from_file_path = self ._get_test_file_path (Path ('examples/example1_outputunits.txt' )),
447
+ params = {'Units:O&M Make-up Water costs' : 'MEUR/yr' },
448
+ )
449
+ )
450
+
451
+ e_msg = str (re_omwc .exception )
452
+
453
+ self .assertIn (
454
+ 'Error: GEOPHIRES failed to convert your currency for O&M Make-up Water costs to something it understands.' ,
455
+ e_msg ,
456
+ )
457
+ self .assertIn ('You gave MEUR' , e_msg )
458
+ self .assertIn ('https://github.com/NREL/GEOPHIRES-X/issues/236' , e_msg )
0 commit comments