@@ -36,10 +36,23 @@ def mock_list_repos(*args, **kwargs):
36
36
]
37
37
38
38
39
+ # pylint: disable=unused-argument
40
+ def mock_get_contribs (* args ):
41
+ """Function to monkeypatch `update_cp_org_libraries.get_contributors()` to ensure
42
+ proper testing of usage. Monkeypatched `list_repos` will likely not produce results.
43
+ """
44
+ contribs = ["test_user1" , "test_user2" ]
45
+ reviewers = ["test_reviewer1" , "test_reviewer2" ]
46
+ merged_pr_count = 4
47
+
48
+ return contribs , reviewers , merged_pr_count
49
+
50
+
39
51
def test_update_cp_org_libraries (monkeypatch ):
40
52
"""Test main function of 'circuitpyton_libraries.py', without writing an output file."""
41
53
42
54
monkeypatch .setattr (common_funcs , "list_repos" , mock_list_repos )
55
+ monkeypatch .setattr (update_cp_org_libraries , "get_contributors" , mock_get_contribs )
43
56
44
57
update_cp_org_libraries .main ()
45
58
@@ -49,6 +62,7 @@ def test_update_cp_org_libraries_output_file(monkeypatch, tmp_path, capsys):
49
62
"""Test main funciton of 'update_cp_org_libraries.py', with writing an output file."""
50
63
51
64
monkeypatch .setattr (common_funcs , "list_repos" , mock_list_repos )
65
+ monkeypatch .setattr (update_cp_org_libraries , "get_contributors" , mock_get_contribs )
52
66
53
67
tmp_output_file = tmp_path / "output_test.txt"
54
68
0 commit comments