Skip to content

Commit 5e36264

Browse files
Implement GeophiresInputEnum.__ne__
1 parent 868acc8 commit 5e36264

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/geophires_x/OptionList.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ def __init__(self, int_value: int, _: str):
2121
def __eq__(self, other):
2222
return str(self) == str(other)
2323

24+
def __ne__(self, other):
25+
return str(self) != str(other)
26+
2427

2528
class EndUseOptions(GeophiresInputEnum):
2629
ELECTRICITY = 1, "Electricity"

tests/geophires_x_tests/test_options_list.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ def test_equality(self):
2323
self.assertTrue(EndUseOptions.HEAT == EndUseOptions.HEAT)
2424
self.assertFalse(EndUseOptions.HEAT is None)
2525
self.assertTrue(EndUseOptions.HEAT is EndUseOptions.HEAT)
26+
self.assertTrue(EndUseOptions.HEAT != EndUseOptions.ELECTRICITY)
27+
self.assertFalse(EndUseOptions.HEAT is EndUseOptions.ELECTRICITY)
28+
self.assertTrue(EndUseOptions.HEAT is not EndUseOptions.ELECTRICITY)
29+
self.assertTrue(EndUseOptions.HEAT != EndUseOptions.ELECTRICITY)
2630
# self.assertTrue(EndUseOptions.HEAT == 'HEAT')
2731
# self.assertFalse(EndUseOptions.HEAT == 'Electricity')
2832

0 commit comments

Comments
 (0)