def test_normal_execution(self, mock_isfile, mock_glob):
""" Test the normal behaviour of the function.
"""
# Set the mocked function returned values.
mock_isfile.side_effect = [True]
mock_glob.return_value = ["/my/path/mock_output"]
# Test execution
fslreorient2std(**self.kwargs)
self.assertEqual([
mock.call(["which", "fslreorient2std"],
env={}, stderr=-1, stdout=-1),
mock.call(["fslreorient2std",
self.kwargs["input_image"],
self.kwargs["output_image"]],
cwd=None, env={}, stderr=-1, stdout=-1)],
self.mock_popen.call_args_list)
self.assertEqual(len(self.mock_env.call_args_list), 1)
评论列表
文章目录