Skip to content

Commit 4aa5d28

Browse files
committed
Updating the test case to check the values
1 parent 3c88c9f commit 4aa5d28

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

generated/nifake/nifake/unit_tests/test_session.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,13 +838,15 @@ def test_return_timedeltas(self):
838838
assert returned_timedeltas == expected_timedeltas
839839
self.patched_library_interpreter.return_list_of_durations_in_seconds.assert_called_once_with(len(time_values))
840840

841-
def test_function_with_int_flag_parameter_with_specific_flags(self):
842-
flags = nifake.IntFlagEnum.A | nifake.IntFlagEnum.B
841+
def test_function_with_int_flag_parameter_with_specific_flag(self):
842+
flags = nifake.IntFlagEnum.C
843843
self.patched_library_interpreter.function_with_int_flag_parameter.side_effect = None
844844
self.patched_library_interpreter.function_with_int_flag_parameter.return_value = None
845845
with nifake.Session('dev1') as session:
846846
session.function_with_int_flag_parameter(flags)
847847
self.patched_library_interpreter.function_with_int_flag_parameter.assert_called_once_with(flags)
848+
called_arg = self.patched_library_interpreter.function_with_int_flag_parameter.call_args[0][0]
849+
assert called_arg == 1 or called_arg.value == 4
848850

849851
def test_function_with_int_flag_parameter_invalid_type(self):
850852
invalid_flag = "not_an_intflag"

src/nifake/unit_tests/test_session.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,13 +838,15 @@ def test_return_timedeltas(self):
838838
assert returned_timedeltas == expected_timedeltas
839839
self.patched_library_interpreter.return_list_of_durations_in_seconds.assert_called_once_with(len(time_values))
840840

841-
def test_function_with_int_flag_parameter_with_specific_flags(self):
842-
flags = nifake.IntFlagEnum.A | nifake.IntFlagEnum.B
841+
def test_function_with_int_flag_parameter_with_specific_flag(self):
842+
flags = nifake.IntFlagEnum.C
843843
self.patched_library_interpreter.function_with_int_flag_parameter.side_effect = None
844844
self.patched_library_interpreter.function_with_int_flag_parameter.return_value = None
845845
with nifake.Session('dev1') as session:
846846
session.function_with_int_flag_parameter(flags)
847847
self.patched_library_interpreter.function_with_int_flag_parameter.assert_called_once_with(flags)
848+
called_arg = self.patched_library_interpreter.function_with_int_flag_parameter.call_args[0][0]
849+
assert called_arg == 1 or called_arg.value == 4
848850

849851
def test_function_with_int_flag_parameter_invalid_type(self):
850852
invalid_flag = "not_an_intflag"

0 commit comments

Comments
 (0)