input: Write a python function to perform a serial communication test on a device.
  assert do_test('/dev/ttyUSB0', 57600, 'autodeclination') == True
  assert do_test('/dev/ttyUSB0', 57600, 'bezier') == True
  assert do_test('/dev/ttyUSB0', 57600, 'bson') == True
output: import serial
  
  def do_test(port, baudrate, test_string):
      try:
          with serial.Serial(port, baudrate, timeout=1) as ser:
              ser.write(test_string.encode())
              ser.flush()
              response = ser.read(len(test_string))
              return response.decode() == test_string
      except:
          return False