예제 #1
0
def test_factory_fails():
    config = BaseConfig()
    config.settings.update({"name": "Nothing"})
    with pytest.raises(NoCommitizenFoundException) as excinfo:
        factory.commiter_factory(config)

    assert "The committer has not been found in the system." in str(excinfo)
예제 #2
0
def config():
    _config = BaseConfig()
    _config.settings.update({"name": defaults.name})
    return _config
예제 #3
0
def config():
    _config = BaseConfig()
    _config.settings.update({"name": defaults.DEFAULT_SETTINGS["name"]})
    return _config
예제 #4
0
def test_factory():
    config = BaseConfig()
    config.settings.update({"name": defaults.DEFAULT_SETTINGS["name"]})
    r = factory.commiter_factory(config)
    assert isinstance(r, BaseCommitizen)
예제 #5
0
def config():
    _config = BaseConfig()
    _config._settings["name"] = defaults.name
    return _config
예제 #6
0
def test_factory_fails():
    config = BaseConfig()
    config.settings.update({"name": "Nothing"})
    with pytest.raises(SystemExit):
        factory.commiter_factory(config)
예제 #7
0
def test_initialize_cz_customize_failed():
    with pytest.raises(MissingCzCustomizeConfigError) as excinfo:
        config = BaseConfig()
        _ = CustomizeCommitsCz(config)

    assert MissingCzCustomizeConfigError.message in str(excinfo.value)
예제 #8
0
def test_initialize_cz_customize_failed():
    with pytest.raises(SystemExit) as excinfo:
        config = BaseConfig()
        _ = CustomizeCommitsCz(config)

    assert excinfo.value.code == MISSING_CONFIG