test(vertex_ai): actually annotate web-search regression vars as Final

Address the Greptile review on #36397. The earlier commit only ratcheted
the LIT010 budget; it never applied the annotations, so
duplicates_in_one_item and duplicates_across_items were still bound
without a Final declaration (LIT010) and the first fixture line was at the
120-char ceiling. Annotate both with `: Final` and wrap the long literal.

RED -> GREEN: check_type_discipline flagged both vars LIT010 before ->
LIT010 gone after (file total 551 -> 549, LIT002 unchanged at 953);
test_calculate_web_search_requests_counts_unique_queries still passes.
This commit is contained in:
Ousama Ben Younes 2026-08-15 08:07:20 +00:00
parent 2bdae174e3
commit 5d7dee710b

View file

@ -2,7 +2,7 @@ import asyncio
import json
import re
from copy import deepcopy
from typing import List, cast
from typing import Final, List, cast
from unittest.mock import MagicMock, patch
import pytest
@ -5562,10 +5562,12 @@ def test_calculate_web_search_requests_counts_unique_queries():
metadata items must collapse to the distinct-query count, and empty strings must
be ignored, matching Google's documented Grounding-with-Search billing rule.
"""
duplicates_in_one_item = [{"webSearchQueries": ["euro 2024 winner", "euro 2024 winner", "spain england final", ""]}]
duplicates_in_one_item: Final = [
{"webSearchQueries": ["euro 2024 winner", "euro 2024 winner", "spain england final", ""]}
]
assert VertexGeminiConfig._calculate_web_search_requests(duplicates_in_one_item) == 2
duplicates_across_items = [
duplicates_across_items: Final = [
{"webSearchQueries": ["euro 2024 winner"]},
{"webSearchQueries": ["euro 2024 winner", "spain england final"]},
]