def test_validate_query_case_insensitive_search_methods(self):
        """Test that search method validation is case insensitive for all query types."""
        search_method_cases = [
            ("tensor", SearchMethod.TENSOR),
            ("TENSOR", SearchMethod.TENSOR),
            ("Tensor", SearchMethod.TENSOR),
            ("lexical", SearchMethod.LEXICAL),
            ("LEXICAL", SearchMethod.LEXICAL),
            ("Lexical", SearchMethod.LEXICAL),
            ("hybrid", SearchMethod.HYBRID),
            ("HYBRID", SearchMethod.HYBRID),
            ("Hybrid", SearchMethod.HYBRID),
        ]

        query_cases = [
            ("string", "test", True, True, True),  # valid for all methods
            ("custom_vector", self.valid_custom_vector_query, True, False, True),  # valid for tensor/hybrid only
            ("dict", self.valid_dict_query, True, False, False)  # valid for tensor only
        ]

        for search_method_str, search_method_enum in search_method_cases:
            for query_type, query, valid_tensor, valid_lexical, valid_hybrid in query_cases:
                should_succeed = (
                        (search_method_enum == SearchMethod.TENSOR and valid_tensor) or
                        (search_method_enum == SearchMethod.LEXICAL and valid_lexical) or
                        (search_method_enum == SearchMethod.HYBRID and valid_hybrid)
                )

                with self.subTest(search_method=search_method_str, query_type=query_type):
                    if should_succeed:
                        # Test string version
                        result = validation.validate_query(query, search_method_str)
                        self.assertEqual(result, query)

                        # Test enum version for comparison
                        result_enum = validation.validate_query(query, search_method_enum)
                        self.assertEqual(result, result_enum)
                    else:
                        with self.assertRaises(InvalidArgError):
                            validation.validate_query(query, search_method_str)
Test that search method validation is case insensitive for all query types.
tests/unit_tests/marqo/tensor_search/test_validation.py