File tree 2 files changed +5
-3
lines changed
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ def main(argv=None):
88
88
'Probably to keep line numbers of secrets up-to-date.\n '
89
89
'Please `git add {}`, thank you.\n \n ' .format (args .baseline [0 ]),
90
90
)
91
- return 1
91
+ return 3
92
92
93
93
return 0
94
94
Original file line number Diff line number Diff line change 18
18
def assert_commit_blocked (command ):
19
19
assert pre_commit_hook .main (command .split ()) == 1
20
20
21
+ def assert_commit_blocked_with_diff_exit_code (command ):
22
+ assert pre_commit_hook .main (command .split ()) == 3
21
23
22
24
def assert_commit_succeeds (command ):
23
25
assert pre_commit_hook .main (command .split ()) == 0
@@ -154,7 +156,7 @@ def test_that_baseline_gets_updated(
154
156
), mock .patch (
155
157
'detect_secrets.pre_commit_hook.write_baseline_to_file' ,
156
158
) as m :
157
- assert_commit_blocked (
159
+ assert_commit_blocked_with_diff_exit_code (
158
160
'--baseline will_be_mocked --use-all-plugins' +
159
161
' test_data/files/file_with_secrets.py' ,
160
162
)
@@ -210,7 +212,7 @@ def test_writes_new_baseline_if_modified(self):
210
212
), mock .patch (
211
213
'detect_secrets.pre_commit_hook.write_baseline_to_file' ,
212
214
) as m :
213
- assert_commit_blocked (
215
+ assert_commit_blocked_with_diff_exit_code (
214
216
'--baseline will_be_mocked test_data/files/file_with_secrets.py' ,
215
217
)
216
218
You can’t perform that action at this time.
0 commit comments