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)
def config(): _config = BaseConfig() _config.settings.update({"name": defaults.name}) return _config
def config(): _config = BaseConfig() _config.settings.update({"name": defaults.DEFAULT_SETTINGS["name"]}) return _config
def test_factory(): config = BaseConfig() config.settings.update({"name": defaults.DEFAULT_SETTINGS["name"]}) r = factory.commiter_factory(config) assert isinstance(r, BaseCommitizen)
def config(): _config = BaseConfig() _config._settings["name"] = defaults.name return _config
def test_factory_fails(): config = BaseConfig() config.settings.update({"name": "Nothing"}) with pytest.raises(SystemExit): factory.commiter_factory(config)
def test_initialize_cz_customize_failed(): with pytest.raises(MissingCzCustomizeConfigError) as excinfo: config = BaseConfig() _ = CustomizeCommitsCz(config) assert MissingCzCustomizeConfigError.message in str(excinfo.value)
def test_initialize_cz_customize_failed(): with pytest.raises(SystemExit) as excinfo: config = BaseConfig() _ = CustomizeCommitsCz(config) assert excinfo.value.code == MISSING_CONFIG