Skip to content

Commit 7d9ed41

Browse files
committed
add missing coverage
1 parent bfe9f2a commit 7d9ed41

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

.generator/parse_googleapis_content.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
"glob",
104104
)
105105

106+
106107
def parse_content(content: str) -> dict:
107108
"""Parses content from BUILD.bazel and returns a dictionary
108109
containing bazel rules and arguments.

.generator/test_cli.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,24 @@ def test_handle_release_init_success(mocker, mock_release_init_request_file):
856856
handle_release_init()
857857

858858

859+
def test_handle_release_init_is_generated_success(
860+
mocker, mock_release_init_request_file
861+
):
862+
"""
863+
Tests that `handle_release_init` calls `_update_global_changelog` when the
864+
`packages` directory exists.
865+
"""
866+
mocker.patch("pathlib.Path.exists", return_value=True)
867+
mock_update_global_changelog = mocker.patch("cli._update_global_changelog")
868+
mocker.patch("cli._update_version_for_library")
869+
mocker.patch("cli._get_previous_version", return_value="1.2.2")
870+
mocker.patch("cli._update_changelog_for_library")
871+
872+
handle_release_init()
873+
874+
mock_update_global_changelog.assert_called_once()
875+
876+
859877
def test_handle_release_init_fail_value_error_file():
860878
"""
861879
Tests that handle_release_init fails to read `librarian/release-init-request.json`.

0 commit comments

Comments
 (0)