Skip to content

Commit c2464d1

Browse files
Test cast enum from string
1 parent f856487 commit c2464d1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/geophires_x_tests/test_options_list.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ def test_get_end_use_option_from_input_string(self):
1111
with self.assertRaises(ValueError):
1212
EndUseOptions.get_end_use_option_from_input_string('2034982309')
1313

14+
def test_cast_from_name_string(self):
15+
self.assertIs(EndUseOptions('Electricity'), EndUseOptions.ELECTRICITY)
16+
self.assertIs(EndUseOptions('Direct-Use Heat'), EndUseOptions.HEAT)
17+
1418
def test_equality(self):
1519
self.assertFalse(EndUseOptions.HEAT == EndUseOptions.ELECTRICITY)
1620
self.assertTrue(EndUseOptions.HEAT == EndUseOptions.HEAT)

0 commit comments

Comments
 (0)