MCPcopy
hub / github.com/commitizen-tools/commitizen / test_scm_provider

Function test_scm_provider

tests/providers/test_scm_provider.py:42–63  ·  view source on GitHub ↗
(
    config: BaseConfig,
    tag_format: str,
    tag: str,
    expected_version: str,
    util: UtilFixture,
)

Source from the content-addressed store, hash-verified

40)
41@pytest.mark.usefixtures("tmp_git_project")
42def test_scm_provider(
43 config: BaseConfig,
44 tag_format: str,
45 tag: str,
46 expected_version: str,
47 util: UtilFixture,
48):
49 util.create_file_and_commit("test: fake commit")
50 util.create_tag(tag)
51 util.create_file_and_commit("test: fake commit")
52 util.create_tag("should-not-match")
53
54 config.settings["version_provider"] = "scm"
55 config.settings["tag_format"] = tag_format
56
57 provider = get_provider(config)
58 assert isinstance(provider, ScmProvider)
59 actual_version = provider.get_version()
60 assert actual_version == expected_version
61
62 # Should not fail on set_version()
63 provider.set_version("43.1")
64
65
66@pytest.mark.usefixtures("tmp_git_project")

Callers

nothing calls this directly

Calls 5

get_providerFunction · 0.90
create_tagMethod · 0.80
get_versionMethod · 0.45
set_versionMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…