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

Function test_discover_external_plugin

tests/test_factory.py:95–110  ·  view source on GitHub ↗
(mocker)

Source from the content-addressed store, hash-verified

93
94
95def test_discover_external_plugin(mocker):
96 ep_plugin = metadata.EntryPoint(
97 "test", "tests.test_factory:Plugin", "commitizen.plugin"
98 )
99 ep_other_plugin = metadata.EntryPoint(
100 "not-selected", "tests.test_factory::OtherPlugin", "commitizen.not_a_plugin"
101 )
102 eps = [ep_plugin, ep_other_plugin]
103
104 def mock_entrypoints(**kwargs):
105 group = kwargs.get("group")
106 return metadata.EntryPoints(ep for ep in eps if ep.group == group)
107
108 mocker.patch.object(metadata, "entry_points", side_effect=mock_entrypoints)
109
110 assert discover_plugins() == {"test": Plugin}
111
112
113def test_discover_internal_plugins():

Callers

nothing calls this directly

Calls 1

discover_pluginsFunction · 0.90

Tested by

no test coverage detected