diff --git a/build/templates/enums.py.mako b/build/templates/enums.py.mako index ce6d0e535..c6451214a 100644 --- a/build/templates/enums.py.mako +++ b/build/templates/enums.py.mako @@ -6,13 +6,13 @@ config = template_parameters['metadata'].config enums = config['enums'] %> from enum import Enum -% if any(enums[e].get('enum_class', 'Enum') == 'IntFlag' for e in enums): +% if any(enums[e].get('class', 'Enum') == 'IntFlag' for e in enums): from enum import IntFlag % endif % for enum_name in sorted(helper.filter_codegen_enums(enums)): -class ${enums[enum_name]['python_name']}(${enums[enum_name].get('enum_class', 'Enum')}): +class ${enums[enum_name]['python_name']}(${enums[enum_name].get('class', 'Enum')}): <% print_list = [] %>\ diff --git a/generated/nifake/nifake/enums.py b/generated/nifake/nifake/enums.py index 40ac0fe6b..cd042c61c 100644 --- a/generated/nifake/nifake/enums.py +++ b/generated/nifake/nifake/enums.py @@ -63,9 +63,9 @@ class IntFlagEnum(IntFlag): r''' Flag B option. ''' - C = 9223372036854775808 + E = 1073741824 r''' - Flag C option. + Flag E option. ''' diff --git a/generated/nifake/nifake/unit_tests/test_session.py b/generated/nifake/nifake/unit_tests/test_session.py index 17b6fd542..9621e851b 100644 --- a/generated/nifake/nifake/unit_tests/test_session.py +++ b/generated/nifake/nifake/unit_tests/test_session.py @@ -839,12 +839,12 @@ def test_return_timedeltas(self): self.patched_library_interpreter.return_list_of_durations_in_seconds.assert_called_once_with(len(time_values)) def test_with_valid_intflag_parameter(self): - flags = nifake.IntFlagEnum.C | nifake.IntFlagEnum.A + flags = nifake.IntFlagEnum.E | nifake.IntFlagEnum.A self.patched_library_interpreter.function_with_intflag_parameter.side_effect = None self.patched_library_interpreter.function_with_intflag_parameter.return_value = None with nifake.Session('dev1') as session: session.function_with_intflag_parameter(flags) - self.patched_library_interpreter.function_with_intflag_parameter.assert_called_once_with(9223372036854775809) + self.patched_library_interpreter.function_with_intflag_parameter.assert_called_once_with(1073741825) def test_with_intflag_parameter_invalid(self): invalid_flag = 5 diff --git a/src/nifake/metadata/enums.py b/src/nifake/metadata/enums.py index 0463980b5..9baf304c2 100644 --- a/src/nifake/metadata/enums.py +++ b/src/nifake/metadata/enums.py @@ -240,8 +240,8 @@ ] }, 'IntFlagEnum': { + 'class': 'IntFlag', 'codegen_method': 'public', - 'enum_class': 'IntFlag', 'values': [ { 'documentation': { @@ -259,10 +259,10 @@ }, { 'documentation': { - 'description': 'Flag C option.' + 'description': 'Flag E option.' }, - 'name': 'NIFAKE_VAL_FLAG_C', - 'value': 9223372036854775808 + 'name': 'NIFAKE_VAL_FLAG_E', + 'value': 1073741824 } ] }, diff --git a/src/nifake/unit_tests/test_session.py b/src/nifake/unit_tests/test_session.py index 17b6fd542..9621e851b 100644 --- a/src/nifake/unit_tests/test_session.py +++ b/src/nifake/unit_tests/test_session.py @@ -839,12 +839,12 @@ def test_return_timedeltas(self): self.patched_library_interpreter.return_list_of_durations_in_seconds.assert_called_once_with(len(time_values)) def test_with_valid_intflag_parameter(self): - flags = nifake.IntFlagEnum.C | nifake.IntFlagEnum.A + flags = nifake.IntFlagEnum.E | nifake.IntFlagEnum.A self.patched_library_interpreter.function_with_intflag_parameter.side_effect = None self.patched_library_interpreter.function_with_intflag_parameter.return_value = None with nifake.Session('dev1') as session: session.function_with_intflag_parameter(flags) - self.patched_library_interpreter.function_with_intflag_parameter.assert_called_once_with(9223372036854775809) + self.patched_library_interpreter.function_with_intflag_parameter.assert_called_once_with(1073741825) def test_with_intflag_parameter_invalid(self): invalid_flag = 5 diff --git a/src/nirfsg/metadata/enums.py b/src/nirfsg/metadata/enums.py index 7425de90f..2e88e47c1 100644 --- a/src/nirfsg/metadata/enums.py +++ b/src/nirfsg/metadata/enums.py @@ -958,7 +958,7 @@ ] }, 'ResetWithOptionsStepsToOmit': { - 'enum_class': 'IntFlag', + 'class': 'IntFlag', 'values': [ { 'documentation': { @@ -1066,7 +1066,7 @@ ] }, 'SelfCalibrateRangeStepsToOmit': { - 'enum_class': 'IntFlag', + 'class': 'IntFlag', 'values': [ { 'documentation': {