code: def test_cohort_filter_validate_method(self):
      with pytest.raises(
          UserConfigValidationException,
          match="Got unexpected type <class 'int'> for method. "
          "Expected string type.",
      ):
          CohortFilter(method=1, arg=[], column=1)
  
      with pytest.raises(
          UserConfigValidationException,
          match="Got unexpected value random for method. "
          "Expected either of greater or "
          "greater and equal or "
          "less or less and equal or "
          "equal or includes or "
          "excludes or in the range of.",
      ):
          CohortFilter(method="random", arg=[], column="random")
  
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 1 for calling the TestCohortFilter obj's underlying member method code with example usage: obj.test_cohort_filter_validate_method() without return types