def testExtendOpErrorNotList(self): # Should be a list. values = StructuredTensor.from_pyval({}) def leaf_op(values): return values[0] with self.assertRaisesRegex(ValueError, "Expected a list"): structured_array_ops._extend_op(values, leaf_op)
def testExtendOpErrorEmptyList(self): def leaf_op(values): return values[0] with self.assertRaisesRegex(ValueError, "List cannot be empty"): structured_array_ops._extend_op([], leaf_op)