def test_example(config):
    cz = CustomizeCommitsCz(config)
    assert "feature: this feature eanable customize through config file" in cz.example(
    )
def test_schema(config):
    cz = CustomizeCommitsCz(config)
    assert "<type>: <body>" in cz.schema()
Esempio n. 3
0
def test_initialize_cz_customize_failed():
    with pytest.raises(MissingCzCustomizeConfigError) as excinfo:
        config = BaseConfig()
        _ = CustomizeCommitsCz(config)

    assert MissingCzCustomizeConfigError.message in str(excinfo.value)
Esempio n. 4
0
def test_bump_pattern(config):
    cz = CustomizeCommitsCz(config)
    assert cz.bump_pattern == "^(break|new|fix|hotfix)"
Esempio n. 5
0
def test_change_type_map(config):
    cz = CustomizeCommitsCz(config)
    assert cz.change_type_map == {"feature": "Feat", "bug fix": "Fix"}
Esempio n. 6
0
def test_info(config):
    cz = CustomizeCommitsCz(config)
    assert "This is a customized cz." in cz.info()
Esempio n. 7
0
def test_changelog_pattern(config):
    cz = CustomizeCommitsCz(config)
    assert cz.changelog_pattern == "^(feature|bug fix)?(!)?"
Esempio n. 8
0
def test_commit_parser(config):
    cz = CustomizeCommitsCz(config)
    assert cz.commit_parser == "^(?P<change_type>feature|bug fix):\\s(?P<message>.*)?"
Esempio n. 9
0
def test_info_without_info(config_without_info):
    cz = CustomizeCommitsCz(config_without_info)
    assert cz.info() is None
Esempio n. 10
0
def test_schema_pattern(config):
    cz = CustomizeCommitsCz(config)
    assert r"(feature|bug fix):(\s.*)" in cz.schema_pattern()
def test_initialize_cz_customize_failed():
    with pytest.raises(SystemExit) as excinfo:
        config = BaseConfig()
        _ = CustomizeCommitsCz(config)

    assert excinfo.value.code == MISSING_CONFIG