@@ -980,3 +980,47 @@ def test_bump_command_prelease_version_type_check_old_tags(
980
980
for version_file in [tmp_version_file , tmp_commitizen_cfg_file ]:
981
981
with open (version_file , "r" ) as f :
982
982
assert "0.2.0" in f .read ()
983
+
984
+
985
+ @pytest .mark .usefixtures ("tmp_commitizen_project" )
986
+ @pytest .mark .usefixtures ("use_cz_semver" )
987
+ @pytest .mark .parametrize (
988
+ "message, expected_tag" ,
989
+ [
990
+ ("minor: add users" , "0.2.0" ),
991
+ ("patch: bug affecting users" , "0.1.1" ),
992
+ ("major: bug affecting users" , "1.0.0" ),
993
+ ],
994
+ )
995
+ def test_bump_with_plugin (mocker : MockFixture , message : str , expected_tag : str ):
996
+ create_file_and_commit (message )
997
+
998
+ testargs = ["cz" , "--name" , "cz_semver" , "bump" , "--yes" ]
999
+ mocker .patch .object (sys , "argv" , testargs )
1000
+ cli .main ()
1001
+
1002
+ tag_exists = git .tag_exist (expected_tag )
1003
+ assert tag_exists is True
1004
+
1005
+
1006
+ @pytest .mark .usefixtures ("tmp_commitizen_project" )
1007
+ @pytest .mark .usefixtures ("use_cz_semver" )
1008
+ @pytest .mark .parametrize (
1009
+ "message, expected_tag" ,
1010
+ [
1011
+ ("minor: add users" , "0.2.0" ),
1012
+ ("patch: bug affecting users" , "0.1.1" ),
1013
+ ("major: bug affecting users" , "0.2.0" ),
1014
+ ],
1015
+ )
1016
+ def test_bump_with_major_version_zero_with_plugin (
1017
+ mocker : MockFixture , message : str , expected_tag : str
1018
+ ):
1019
+ create_file_and_commit (message )
1020
+
1021
+ testargs = ["cz" , "--name" , "cz_semver" , "bump" , "--yes" , "--major-version-zero" ]
1022
+ mocker .patch .object (sys , "argv" , testargs )
1023
+ cli .main ()
1024
+
1025
+ tag_exists = git .tag_exist (expected_tag )
1026
+ assert tag_exists is True
0 commit comments