code: def testFromComponentsError(self):
      spec = resource_variable_ops.VariableSpec(
          shape=[1], dtype=dtypes.float32
      )
      self.assertRaisesRegex(
          TypeError,
          "must be a list or tuple",
          spec._from_components,
          constant_op.constant(1.0),
      )
      self.assertRaisesRegex(
          ValueError,
          "must only contain its resource handle",
          spec._from_components,
          [constant_op.constant(1.0), constant_op.constant(2.0)],
      )
      self.assertRaisesRegex(
          ValueError,
          "must be a resource tensor",
          spec._from_components,
          [constant_op.constant(1.0)],
      )
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.platform import test
  from tensorflow.python.util import nest
label_desc: Use image node_id 6 for calling the VariableSpecTest obj's underlying member method code with example usage: obj.testFromComponentsError() without return types