File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 1010
1111from commitizen import cmd , commands
1212from commitizen .__version__ import __version__
13+ from commitizen .cz import registry
1314from commitizen .exceptions import InitFailedError , NoAnswersError
1415
1516if TYPE_CHECKING :
@@ -462,3 +463,22 @@ def test_init_configuration_with_version_provider(
462463 assert (
463464 "version = " not in config_data
464465 ) # Version should not be set when using version_provider
466+
467+
468+ def test_construct_name_choice_with_description (
469+ config : BaseConfig , mocker : MockFixture
470+ ):
471+ """Test the construction of cz name choices with descriptions."""
472+ init = commands .Init (config )
473+ # mock the registry to have only one cz for testing
474+ mocker .patch .dict (
475+ "commitizen.cz.registry" ,
476+ {"cz_conventional_commits" : registry ["cz_conventional_commits" ]},
477+ clear = True ,
478+ )
479+ choices = init ._construct_name_choice_with_description ()
480+ assert len (choices ) == 1
481+ choice = choices [0 ]
482+ assert choice .title == "cz_conventional_commits"
483+ assert choice .value == "cz_conventional_commits"
484+ assert choice .description == "<type>(<scope>): <subject>"
You can’t perform that action at this time.
0 commit comments