MCPcopy Create free account
hub / github.com/commitizen-tools/commitizen / test_generate_ordered_changelog_tree

Function test_generate_ordered_changelog_tree

tests/test_changelog.py:1213–1226  ·  view source on GitHub ↗
(change_type_order, expected_reordering)

Source from the content-addressed store, hash-verified

1211 ],
1212)
1213def test_generate_ordered_changelog_tree(change_type_order, expected_reordering):
1214 tree = changelog.generate_ordered_changelog_tree(COMMITS_TREE, change_type_order)
1215
1216 for index, entry in enumerate(tuple(tree)):
1217 version = entry["version"]
1218 if version in expected_reordering:
1219 # Verify that all keys are present
1220 assert [*entry.keys()] == [*COMMITS_TREE[index].keys()]
1221 # Verify that the reorder only impacted the returned dict and not the original
1222 expected = expected_reordering[version]
1223 assert [*entry["changes"].keys()] == expected["sorted"]
1224 assert [*COMMITS_TREE[index]["changes"].keys()] == expected["original"]
1225 else:
1226 assert [*entry["changes"].keys()] == [*entry["changes"].keys()]
1227
1228
1229def test_generate_ordered_changelog_tree_raises():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected