text: #!/usr/bin/env python
  
  import rospy, unittest, rostest
  import rosnode
  import time
  from std_msgs.msg import UInt16
  
  class BuzzerTest(unittest.TestCase):
  
      def test_node_exist(self):
          nodes = rosnode.get_node_names()
          self.assertIn("/buzzer", nodes, "node does not exist")
  
      def test_put_value(self):
          pub = rospy.Publisher("/buzzer", UInt16)
          for i in range(10):
              pub.publish(i*100)
              time.sleep(0.1)
  
          pub.publish(0)
          #with open("/dev/rtbuzzer0", 'r') as file:
              #data = file.readline()
              #self.assertEqual(data, "1234\n", "value does not written to rtbuzzer0")
  
  
  if __name__ == "__main__":
      time.sleep(3)
      rospy.init_node("my_test_buzzer")
      rostest.rosrun("pimouse_ros", "my_test_buzzer", BuzzerTest)
  