Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit e334e8e

Browse files
committed
updates order and comments for test__validate_paged_field_size_type
1 parent 1c4265a commit e334e8e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/unit/schema/wrappers/test_method.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,10 +1015,12 @@ def test_mixin_rule():
10151015
@pytest.mark.parametrize(
10161016
"field_type, _type, expected",
10171017
[
1018+
# valid paged_result_field candidate
10181019
(int, 5, True), # 5 = int
1019-
(float, 1, None), # 1 = float
10201020
(wrappers_pb2.UInt32Value, 11, True), # 11 = MessageType
10211021
(wrappers_pb2.Int32Value, 11, True), # 11 = MessageType
1022+
# invalid paged_result_field candidate
1023+
(float, 1, None), # 1 = float
10221024
(wrappers_pb2.UInt32Value, 1, None), # 1 = float
10231025
(wrappers_pb2.Int32Value, 1, None), # 1 = float
10241026
],
@@ -1027,7 +1029,10 @@ def test__validate_paged_field_size_type(field_type, _type, expected):
10271029
"""Test _validate_paged_field_size_type with wrapper types and type indicators."""
10281030

10291031
# Setup
1030-
if _type == 11:
1032+
if _type in {5, 1}:
1033+
# The _type values represent int (5) and float (1)
1034+
page_size = make_field(name="page_size", type=_type)
1035+
else:
10311036
# _type 11 is MESSAGETYPE
10321037
# See: https://github.com/googleapis/gapic-generator-python/blob/c8b7229ba2865d6a2f5966aa151be121de81f92d/gapic/schema/wrappers.py#L378C1-L411C10
10331038
# and is only associated with *Int32Value in legacy APIs such as BigQuery.
@@ -1036,9 +1041,6 @@ def test__validate_paged_field_size_type(field_type, _type, expected):
10361041
type=_type,
10371042
message=make_message(name=field_type.DESCRIPTOR.name)
10381043
)
1039-
else:
1040-
# The other _type values represent int (5) and float (1)
1041-
page_size = make_field(name="page_size", type=_type)
10421044

10431045
parent = make_field(name="parent", type=9) # str
10441046
page_token = make_field(name="page_token", type=9) # str

0 commit comments

Comments
 (0)