def test_validate_query_custom_vector_by_search_method(self):
        """Test CustomVectorQuery validation for different search methods."""
        test_cases = [
            (SearchMethod.TENSOR, True, "should succeed for TENSOR"),
            (SearchMethod.HYBRID, True, "should succeed for HYBRID"),
            (SearchMethod.LEXICAL, False, "should fail for LEXICAL")
        ]

        for search_method, should_succeed, description in test_cases:
            with self.subTest(search_method=search_method, description=description):
                if should_succeed:
                    result = validation.validate_query(self.valid_custom_vector_query, search_method)
                    self.assertEqual(result, self.valid_custom_vector_query)
                else:
                    with self.assertRaises(InvalidArgError) as cm:
                        validation.validate_query(self.valid_custom_vector_query, search_method)
                    error_msg = str(cm.exception)
                    self.assertIn("Custom vector search is only supported", error_msg)
                    self.assertIn("search_method=\"HYBRID\"", error_msg)
                    self.assertIn("search_method=\"TENSOR\"", error_msg)
Test CustomVectorQuery validation for different search methods.
tests/unit_tests/marqo/tensor_search/test_validation.py