code: def test_fromobject(self):
      # Test PyBytes_FromObject()
      fromobject = _testcapi.bytes_fromobject
  
      self.assertEqual(fromobject(b"abc"), b"abc")
      self.assertEqual(fromobject(bytearray(b"abc")), b"abc")
      self.assertEqual(fromobject(BytesSubclass(b"abc")), b"abc")
      self.assertEqual(fromobject([97, 98, 99]), b"abc")
      self.assertRaises(TypeError, fromobject, 3)
      self.assertRaises(TypeError, fromobject, BytesLike(b"abc"))
      self.assertRaises(TypeError, fromobject, "abc")
      self.assertRaises(TypeError, fromobject, object())
      self.assertRaises(SystemError, fromobject, NULL)
  
imports: import unittest
  from test.support import import_helper
  from _testcapi import PY_SSIZE_T_MIN, PY_SSIZE_T_MAX
label_desc: Use image node_id 5 for calling the CAPITest obj's underlying member method code with example usage: obj.test_fromobject() without return types