code: def test_cohort_validate_with_test_data(self):
      cohort_filter_1 = CohortFilter(
          method=CohortFilterMethods.METHOD_LESS, arg=[65], column="age"
      )
      cohort_1 = Cohort(name="Cohort New")
      cohort_1.add_cohort_filter(cohort_filter_1)
      test_data = get_toy_binary_classification_dataset()
  
      with pytest.raises(
          UserConfigValidationException,
          match="The test_data should be a pandas DataFrame",
      ):
          cohort_1._validate_with_test_data(
              test_data=[],
              target_column="target",
              categorical_features=[],
          )
  
      with pytest.raises(
          UserConfigValidationException,
          match="The target_column should be string.",
      ):
          cohort_1._validate_with_test_data(
              test_data=test_data,
              target_column=1,
              categorical_features=[],
          )
  
      with pytest.raises(
          UserConfigValidationException,
          match="The target_column fake_target "
          "was not found in test_data.",
      ):
          cohort_1._validate_with_test_data(
              test_data=test_data,
              target_column="fake_target",
              categorical_features=[],
          )
  
      with pytest.raises(
          UserConfigValidationException,
          match="Expected a list type for " "categorical columns.",
      ):
          cohort_1._validate_with_test_data(
              test_data=test_data,
              target_column="target",
              categorical_features={},
          )
  
      with pytest.raises(
          UserConfigValidationException,
          match="Feature 1 in categorical_features need to be of "
          "string type.",
      ):
          cohort_1._validate_with_test_data(
              test_data=test_data,
              target_column="target",
              categorical_features=[1, 2],
          )
  
      with pytest.raises(
          UserConfigValidationException,
          match="Found categorical feature hours-per-week which is not"
          " present in test data.",
      ):
          cohort_1._validate_with_test_data(
              test_data=test_data,
              target_column="target",
              categorical_features=["hours-per-week"],
          )
  
imports: import json
  import pandas
  import pytest
  from raiutils.cohort import ClassificationOutcomes, Cohort, CohortFilter, CohortFilterMethods, cohort_filter_json_converter
  from raiutils.exceptions import UserConfigValidationException
label_desc: Use image node_id 2 for calling the TestCohort obj's underlying member method code with example usage: obj.test_cohort_validate_with_test_data() without return types