8000 test(changelog): cover more smart tag range test cases · commitizen-tools/commitizen@3ac4246 · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3ac4246

Browse files
committed
test(changelog): cover more smart tag range test cases
1 parent a0cc490 commit 3ac4246

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

tests/test_changelog.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1534,7 +1534,27 @@ def test_get_smart_tag_range_returns_an_extra_for_a_range(tags):
15341534
def test_get_smart_tag_range_returns_an_extra_for_a_single_tag(tags):
15351535
start = tags[0] # len here is 1, but we expect one more tag as designed
15361536
res = changelog.get_smart_tag_range(tags, start.name)
1537-
assert 2 == len(res)
1537+
assert res[0].name == tags[0].name
1538+
assert res[1].name == tags[1].name
1539+
1540+
1541+
def test_get_smart_tag_range_returns_an_empty_list_for_nonexistent_end_tag(tags):
1542+
start = tags[0]
1543+
res = changelog.get_smart_tag_range(tags, start.name, "nonexistent")
1544+
assert len(tags) == len(res)
1545+
1546+
1547+
def test_get_smart_tag_range_returns_an_empty_list_for_nonexistent_start_tag(tags):
1548+
end = tags[0]
1549+
res = changelog.get_smart_tag_range(tags, "nonexistent", end.name)
1550+
assert res[0].name == tags[1].name
1551+
1552+
1553+
def test_get_smart_tag_range_returns_an_empty_list_for_nonexistent_start_and_end_tags(
1554+
tags,
1555+
):
1556+
res = changelog.get_smart_tag_range(tags, "nonexistent", "nonexistent")
1557+
assert 0 == len(res)
15381558

15391559

15401560
@dataclass

0 commit comments

Comments
 (0)
0