@@ -30,6 +30,38 @@ def test_pagination_info_from_proto_v1alpha8() -> None:
3030 assert info .next_page_token == "token"
3131
3232
33+ def test_pagination_info_from_proto_v1_no_token () -> None :
34+ """Test the PaginationInfo from_proto method with v1 proto and no token."""
35+ proto = PBPaginationInfo (total_items = 100 )
36+ info = PaginationInfo .from_proto (proto )
37+ assert info .total_items == 100
38+ assert info .next_page_token is None
39+
40+
41+ def test_pagination_info_from_proto_v1alpha8_no_token () -> None :
42+ """Test the PaginationInfo from_proto method with v1alpha8 proto and no token."""
43+ proto = PBPaginationInfoAlpha8 (total_items = 100 )
44+ info = PaginationInfo .from_proto (proto )
45+ assert info .total_items == 100
46+ assert info .next_page_token is None
47+
48+
49+ def test_pagination_info_from_proto_v1_empty_token () -> None :
50+ """Test the PaginationInfo from_proto method with v1 proto and an empty token."""
51+ proto = PBPaginationInfo (total_items = 100 , next_page_token = "" )
52+ info = PaginationInfo .from_proto (proto )
53+ assert info .total_items == 100
54+ assert info .next_page_token is None
55+
56+
57+ def test_pagination_info_from_proto_v1alpha8_empty_token () -> None :
58+ """Test the PaginationInfo from_proto method with v1alpha8 proto and an empty token."""
59+ proto = PBPaginationInfoAlpha8 (total_items = 100 , next_page_token = "" )
60+ info = PaginationInfo .from_proto (proto )
61+ assert info .total_items == 100
62+ assert info .next_page_token is None
63+
64+
3365def test_pagination_info_to_proto_v1 () -> None :
3466 """Test the PaginationInfo to_proto method."""
3567 info = PaginationInfo (total_items = 100 , next_page_token = "token" )
0 commit comments