code: def testToReadonly(self):
      buffer = MPI.buffer
      obj = bytearray(b"abc")
      buf1 = buffer.frombuffer(obj)
      buf2 = buf1.toreadonly()
      self.assertFalse(buf1.readonly)
      self.assertTrue(buf2.readonly)
      self.assertEqual(buf1.address, buf2.address)
      self.assertEqual(buf1.obj, buf2.obj)
      self.assertEqual(type(buf1.obj), type(buf2.obj))
      self.assertEqual(buf1.nbytes, buf2.nbytes)
  
file_path: mpi4py/test/test_buffer.py
imports: from mpi4py import MPI
  import mpiunittest
label_desc: Use image node_id 12 for calling the TestBuffer obj's underlying member method code with example usage: obj.testToReadonly() without return types