ROS-TCP-Endpoint icon indicating copy to clipboard operation
ROS-TCP-Endpoint copied to clipboard

Wrong usage of mock.called_once

Open StephanHasler opened this issue 4 years ago • 2 comments

In several test files the called_once method of mock is used without the required parentheses (). In this way the called_once statements have no effect, the tests seem to succeed, but actually nothing is tested.

See for example: https://github.com/Unity-Technologies/ROS-TCP-Endpoint/blob/58cd28f9bb901c010c5513672591b8ee0b8a8d09/test/test_server.py#L75

In https://github.com/Unity-Technologies/ROS-TCP-Endpoint/blob/58cd28f9bb901c010c5513672591b8ee0b8a8d09/test/test_server.py#L76 there is a further bug, besides the missing parentheses. It should not be checked that the mock is called_once but its getitem method.

StephanHasler avatar Jan 17 '22 09:01 StephanHasler

[AIRO-1689]

hyounesy avatar Jan 25 '22 22:01 hyounesy

This issue has been marked stale because it has been open for 14 days with no activity. Please remove the stale label or comment on this issue, or the issue will be automatically closed in the next 14 days.

github-actions[bot] avatar Feb 09 '22 17:02 github-actions[bot]