Skip to content

Commit 74d6c65

Browse files
use percentage comparison to reduce chances of tedious future test breakage
1 parent be96aae commit 74d6c65

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/test_geophires_x_client.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,9 +531,11 @@ def test_parse_annualized_capital_costs(self):
531531

532532
def test_parse_number_with_commas(self):
533533
result = GeophiresXResult(self._get_test_file_path('examples/S-DAC-GT.out'))
534-
self.assertEqual(result.result['S-DAC-GT ECONOMICS']['Total Cost of Capture']['value'], 499_311_405.59)
535-
gt_lcoh = result.result['S-DAC-GT ECONOMICS']['Geothermal LCOH']['value']
536-
self.assertEqual(gt_lcoh, 0.0017)
534+
self.assertAlmostEqualWithinPercentage(
535+
499_311_405.59, result.result['S-DAC-GT ECONOMICS']['Total Cost of Capture']['value']
536+
)
537+
538+
self.assertAlmostEqualWithinPercentage(result.result['S-DAC-GT ECONOMICS']['Geothermal LCOH']['value'], 0.0017)
537539

538540
def test_parse_sdacgt_profile(self):
539541
result = GeophiresXResult(self._get_test_file_path('examples/S-DAC-GT.out'))

0 commit comments

Comments
 (0)