-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from d3b-center/omitafterpreview
🚸 Ask to omit PRs interactively with live preview
- Loading branch information
Showing
4 changed files
with
113 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Click==7.1.2 | ||
d3b_utils @ git+https://git@github.com/d3b-center/d3b-utils-python.git | ||
emoji==1.2.0 | ||
regex==2020.11.13 | ||
regex==2021.4.4 | ||
semver==2.13.0 | ||
PyGithub==1.54.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
#!/usr/bin/env python | ||
from click.testing import CliRunner | ||
from d3b_release_maker.release_maker import GitHubReleaseNotes | ||
|
||
import pytest | ||
from d3b_release_maker.cli import preview_changelog_cmd | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"type,index", [("foo\nmajor", 0), ("foo\nminor", 1), ("foo\npatch", 2)] | ||
"type,mapping", | ||
[ | ||
("major", {"1.2.3": "2.0.0", "": "1.0.0"}), | ||
("minor", {"1.2.3": "1.3.0", "": "0.1.0"}), | ||
("patch", {"1.2.3": "1.2.4", "": "0.0.1"}), | ||
], | ||
) | ||
def test_version(type, index): | ||
runner = CliRunner() | ||
result = runner.invoke( | ||
preview_changelog_cmd, | ||
args='--repo d3b-center/d3b-release-maker --blurb_file "" --prs_to_ignore ""', | ||
input=f"{type}", | ||
) | ||
assert result.exit_code == 0 | ||
lastlines = result.output.splitlines()[-2:] | ||
versions = [line.split(": ")[1] for line in lastlines] | ||
version_parts = [int(v.split(".")[index]) for v in versions] | ||
assert version_parts[1] == version_parts[0] + 1 | ||
def test_version(type, mapping): | ||
grn = GitHubReleaseNotes() | ||
for start, end in mapping.items(): | ||
assert grn._next_release_version(start, type) == end |