code: def test_errors(self):
      # Test no features
      with self.assertRaisesRegex(
          ValueError, "cannot be None or empty"
      ):
          feature_space.FeatureSpace(features={})
      # Test no crossing dim
      with self.assertRaisesRegex(ValueError, "`crossing_dim`"):
          feature_space.FeatureSpace(
              features={
                  "f1": "integer_categorical",
                  "f2": "integer_categorical",
              },
              crosses=[("f1", "f2")],
              crossing_dim=None,
          )
      # Test wrong cross feature name
      with self.assertRaisesRegex(ValueError, "should be present in "):
          feature_space.FeatureSpace(
              features={
                  "f1": "integer_categorical",
                  "f2": "integer_categorical",
              },
              crosses=[("f1", "unknown")],
              crossing_dim=32,
          )
      # Test wrong output mode
      with self.assertRaisesRegex(
          ValueError, "for argument `output_mode`"
      ):
          feature_space.FeatureSpace(
              features={
                  "f1": "integer_categorical",
                  "f2": "integer_categorical",
              },
              output_mode="unknown",
          )
      # Test call before adapt
      with self.assertRaisesRegex(
          ValueError, "You need to call `.adapt"
      ):
          fs = feature_space.FeatureSpace(
              features={
                  "f1": "integer_categorical",
                  "f2": "integer_categorical",
              }
          )
          fs({"f1": [0], "f2": [0]})
      # Test get_encoded_features before adapt
      with self.assertRaisesRegex(
          ValueError, "You need to call `.adapt"
      ):
          fs = feature_space.FeatureSpace(
              features={
                  "f1": "integer_categorical",
                  "f2": "integer_categorical",
              }
          )
          fs.get_encoded_features()
  
imports: import os
  import pytest
  from tensorflow import data
  from keras import backend
  from keras import layers
  from keras import models
  from keras import ops
  from keras import testing
  from keras.layers.preprocessing import feature_space
  from keras.saving import saving_api
label_desc: Use image node_id 14 for calling the FeatureSpaceTest obj's underlying member method code with example usage: obj.test_errors() without return types