#NEWLINE# def test_publish( self ) : #NEWLINE# #INDENT# ' Make sure that publishing works ' #NEWLINE# topic = '/test_publish' #NEWLINE# msg_type = 'std_msgs/String' #NEWLINE# msg = { #NEWLINE# #INDENT# 'data' : 'why halo thar' , #NEWLINE# #UNINDENT# } #NEWLINE# received = { #NEWLINE# #INDENT# 'msg' : None , #NEWLINE# #UNINDENT# } #NEWLINE# def cb( msg ) : #NEWLINE# #INDENT# received [ 'msg' ] = msg #NEWLINE# #UNINDENT# rospy . Subscriber ( topic , ros_loader . get_message_class ( msg_type ) , cb ) #NEWLINE# p = MultiPublisher ( p , msg_type ) #NEWLINE# p . publish ( msg ) #NEWLINE# sleep ( 0.5 ) #NEWLINE# self . assertEqual ( received [ 'msg' ] . data , msg [ 'data' ] )