@@ -88,7 +88,7 @@ def test_commit_retry_works(config, mocker: MockFixture):
88
88
89
89
commands .Commit (config , {"retry" : True })()
90
90
91
- commit_mock .assert_called_with ("feat: user created\n \n closes #21" )
91
+ commit_mock .assert_called_with ("feat: user created\n \n closes #21" , extra_args = "" )
92
92
prompt_mock .assert_called_once ()
93
93
success_mock .assert_called_once ()
94
94
assert not os .path .isfile (temp_file )
@@ -174,7 +174,7 @@ def test_commit_command_with_signoff_option(config, mocker: MockFixture):
174
174
175
175
commands .Commit (config , {"signoff" : True })()
176
176
177
- commit_mock .assert_called_once_with (ANY , " -s" )
177
+ commit_mock .assert_called_once_with (ANY , extra_args = "-- -s" )
178
178
success_mock .assert_called_once ()
179
179
180
180
@@ -197,7 +197,7 @@ def test_commit_command_with_always_signoff_enabled(config, mocker: MockFixture)
197
197
config .settings ["always_signoff" ] = True
198
198
commands .Commit (config , {})()
199
199
200
- commit_mock .assert_called_once_with (ANY , " -s" )
200
+ commit_mock .assert_called_once_with (ANY , extra_args = "-- -s" )
201
201
success_mock .assert_called_once ()
202
202
203
203
@@ -276,3 +276,23 @@ def test_commit_command_with_all_option(config, mocker: MockFixture):
276
276
commands .Commit (config , {"all" : True })()
277
277
add_mock .assert_called ()
278
278
success_mock .assert_called_once ()
279
+
280
+
281
+ @pytest .mark .usefixtures ("staging_is_clean" )
282
+ def test_commit_command_with_extra_args (config , mocker : MockFixture ):
283
+ prompt_mock = mocker .patch ("questionary.prompt" )
284
+ prompt_mock .return_value = {
285
+ "prefix" : "feat" ,
286
+ "subject" : "user created" ,
287
+ "scope" : "" ,
288
+ "is_breaking_change" : False ,
289
+ "body" : "" ,
290
+ "footer" : "" ,
291
+ }
292
+
293
+ commit_mock = mocker .patch ("commitizen.git.commit" )
294
+ commit_mock .return_value = cmd .Command ("success" , "" , b"" , b"" , 0 )
295
+ success_mock = mocker .patch ("commitizen.out.success" )
296
+ commands .Commit (config , {"extra_cli_args" : "-- -extra-args1 -extra-arg2" })()
297
+ commit_mock .assert_called_once_with (ANY , extra_args = "-- -extra-args1 -extra-arg2" )
298
+ success_mock .assert_called_once ()
0 commit comments