5 from nose.tools
import assert_equal
17 @patch(
'rospy.get_name')
19 mock_get_name.return_value =
'/spam' 21 assert_equal(msg,
'[/spam] [patched] spam')
26 @patch(
'rospy.logdebug')
27 @patch(
'rospy.get_name')
29 mock_get_name.return_value =
'/spam' 31 mock_log.assert_called_with(
'[/spam] [TestJSKLogXXX::test_jsk_logdebug] spam')
33 @patch(
'rospy.loginfo')
34 @patch(
'rospy.get_name')
36 mock_get_name.return_value =
'/spam' 38 mock_log.assert_called_with(
'[/spam] [TestJSKLogXXX::test_jsk_loginfo] spam')
40 @patch(
'rospy.logwarn')
41 @patch(
'rospy.get_name')
43 mock_get_name.return_value =
'/spam' 45 mock_log.assert_called_with(
'[/spam] [TestJSKLogXXX::test_jsk_logwarn] spam')
47 @patch(
'rospy.logerr')
48 @patch(
'rospy.get_name')
50 mock_get_name.return_value =
'/spam' 52 mock_log.assert_called_with(
'[/spam] [TestJSKLogXXX::test_jsk_logerr] spam')
54 @patch(
'rospy.logfatal')
55 @patch(
'rospy.get_name')
57 mock_get_name.return_value =
'/spam' 59 mock_log.assert_called_with(
'[/spam] [TestJSKLogXXX::test_jsk_logfatal] spam')
62 @patch(
'rospy.logwarn')
63 @patch(
'rospy.names.get_resolved_mappings')
64 @patch(
'rosgraph.names.resolve_name')
65 @patch(
'rospy.get_name')
67 mock_get_resolved_mappings, mock_log):
68 mock_get_name.return_value =
'/spam' 69 mock_resolve_name.return_value =
'/spam/input' 70 mock_get_resolved_mappings.return_value = {}
72 mock_log.assert_called_with(
"[/spam] '~input' has not been remapped.")
def test_warn_no_remap(mock_get_name, mock_resolve_name, mock_get_resolved_mappings, mock_log)
def test__log_msg_with_called_location(mock_get_name)
def test_jsk_logfatal(self, mock_get_name, mock_log)
def test_jsk_logerr(self, mock_get_name, mock_log)
def test_jsk_logdebug(self, mock_get_name, mock_log)
def test_jsk_logwarn(self, mock_get_name, mock_log)
def test_jsk_loginfo(self, mock_get_name, mock_log)