Skip to content

Commit 6a064b7

Browse files
re-enable client test_input_hashing with ImmutableGeophiresInputParameters
1 parent 2de8d72 commit 6a064b7

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

tests/test_geophires_x_client.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import tempfile
2-
import unittest
32
import uuid
43
from pathlib import Path
54

65
from geophires_x_client import GeophiresXClient
76
from geophires_x_client import GeophiresXResult
7+
from geophires_x_client import ImmutableGeophiresInputParameters
88
from geophires_x_client.geophires_input_parameters import EndUseOption
99
from geophires_x_client.geophires_input_parameters import GeophiresInputParameters
1010
from tests.base_test_case import BaseTestCase
@@ -421,26 +421,22 @@ def test_non_vertical_section_cost(self):
421421
self.assertIsNotNone(entry['value'])
422422
self.assertEqual(entry['unit'], 'MUSD')
423423

424-
@unittest.skip(
425-
'Not currently relevant - '
426-
'see TODO in geophires_x_client.geophires_input_parameters.GeophiresInputParameters.__hash__'
427-
)
428424
def test_input_hashing(self):
429-
input1 = GeophiresInputParameters(
425+
input1 = ImmutableGeophiresInputParameters(
430426
{'End-Use Option': EndUseOption.DIRECT_USE_HEAT.value, 'Gradient 1': 50, 'Maximum Temperature': 250}
431427
)
432428

433-
input2 = GeophiresInputParameters(
429+
input2 = ImmutableGeophiresInputParameters(
434430
{'Maximum Temperature': 250, 'End-Use Option': EndUseOption.DIRECT_USE_HEAT.value, 'Gradient 1': 50}
435431
)
436432

437-
assert hash(input1) == hash(input2)
433+
self.assertEqual(hash(input1), hash(input2))
438434

439-
input3 = GeophiresInputParameters(
435+
input3 = ImmutableGeophiresInputParameters(
440436
{'Maximum Temperature': 420, 'End-Use Option': EndUseOption.DIRECT_USE_HEAT.value, 'Gradient 1': 69}
441437
)
442438

443-
assert hash(input1) != hash(input3)
439+
self.assertNotEqual(hash(input1), hash(input3))
444440

445441
def test_input_with_non_default_units(self):
446442
client = GeophiresXClient()

0 commit comments

Comments
 (0)