@@ -17,7 +17,7 @@ def fixture_repo(repo_owner: str, repo_name: str) -> Repository:
17
17
return Repository (repo_owner , repo_name )
18
18
19
19
20
- @pytest .mark .usefixtures ("mock_paged_list_labels " )
20
+ @pytest .mark .usefixtures ("mock_list_labels " )
21
21
def test_list_labels (client : Client , repo : Repository ) -> None :
22
22
"""Test that list_labels() requests the labels for the specified repo and
23
23
returns a list of Label instances.
@@ -45,6 +45,32 @@ def test_list_labels(client: Client, repo: Repository) -> None:
45
45
assert [l .params_dict for l in labels ] == expected_params
46
46
47
47
48
+ @pytest .mark .usefixtures ("mock_list_labels_paginated" )
49
+ def test_list_labels_pagination (client : Client , repo : Repository ) -> None :
50
+ """Test that list_labels() supports pagination."""
51
+ labels = client .list_labels (repo )
52
+
53
+ expected_params = [
54
+ {
55
+ "name" : "bug" ,
56
+ "description" : "Bugs and problems with cookiecutter" ,
57
+ "color" : "ea707a" ,
58
+ },
59
+ {
60
+ "name" : "docs" ,
61
+ "description" : "Tasks to write and update documentation" ,
62
+ "color" : "2abf88" ,
63
+ },
64
+ {
65
+ "name" : "infra" ,
66
+ "description" : "Tasks related to Docker/CI etc." ,
67
+ "color" : "f9d03b" ,
68
+ },
69
+ ]
70
+
71
+ assert [l .params_dict for l in labels ] == expected_params
72
+
73
+
48
74
@pytest .mark .usefixtures ("mock_get_label" )
49
75
def test_get_label (client : Client , repo : Repository ) -> None :
50
76
"""Test that get_label() requests the specified label for the repo and
0 commit comments