5
5
CustomBumpRule ,
6
6
SemVerIncrement ,
7
7
_find_highest_increment ,
8
- find_increment_by_callable ,
9
8
)
10
9
from commitizen .defaults import (
11
10
BUMP_MAP ,
@@ -186,7 +185,7 @@ def get_increment(self, bump_rule):
186
185
def test_single_commit (self , get_increment ):
187
186
commit_messages = ["feat: add new feature" ]
188
187
assert (
189
- find_increment_by_callable (commit_messages , get_increment )
188
+ SemVerIncrement . get_highest_by_messages (commit_messages , get_increment )
190
189
== SemVerIncrement .MINOR
191
190
)
192
191
@@ -197,7 +196,7 @@ def test_multiple_commits(self, get_increment):
197
196
"docs: update readme" ,
198
197
]
199
198
assert (
200
- find_increment_by_callable (commit_messages , get_increment )
199
+ SemVerIncrement . get_highest_by_messages (commit_messages , get_increment )
201
200
== SemVerIncrement .MINOR
202
201
)
203
202
@@ -207,7 +206,7 @@ def test_breaking_change(self, get_increment):
207
206
"feat!: breaking change" ,
208
207
]
209
208
assert (
210
- find_increment_by_callable (commit_messages , get_increment )
209
+ SemVerIncrement . get_highest_by_messages (commit_messages , get_increment )
211
210
== SemVerIncrement .MAJOR
212
211
)
213
212
@@ -216,7 +215,7 @@ def test_multi_line_commit(self, get_increment):
216
215
"feat: new feature\n \n BREAKING CHANGE: major change" ,
217
216
]
218
217
assert (
219
- find_increment_by_callable (commit_messages , get_increment )
218
+ SemVerIncrement . get_highest_by_messages (commit_messages , get_increment )
220
219
== SemVerIncrement .MAJOR
221
220
)
222
221
@@ -225,11 +224,17 @@ def test_no_increment_needed(self, get_increment):
225
224
"docs: update documentation" ,
226
225
"style: format code" ,
227
226
]
228
- assert find_increment_by_callable (commit_messages , get_increment ) is None
227
+ assert (
228
+ SemVerIncrement .get_highest_by_messages (commit_messages , get_increment )
229
+ is None
230
+ )
229
231
230
232
def test_empty_commits (self , get_increment ):
231
233
commit_messages = []
232
- assert find_increment_by_callable (commit_messages , get_increment ) is None
234
+ assert (
235
+ SemVerIncrement .get_highest_by_messages (commit_messages , get_increment )
236
+ is None
237
+ )
233
238
234
239
def test_major_version_zero (self ):
235
240
bump_rule = ConventionalCommitBumpRule ()
@@ -239,7 +244,7 @@ def test_major_version_zero(self):
239
244
"BREAKING CHANGE: major change" ,
240
245
]
241
246
assert (
242
- find_increment_by_callable (
247
+ SemVerIncrement . get_highest_by_messages (
243
248
commit_messages , lambda x : bump_rule .get_increment (x , True )
244
249
)
245
250
== SemVerIncrement .MINOR
@@ -253,7 +258,7 @@ def test_mixed_commit_types(self, get_increment):
253
258
"refactor: restructure code" ,
254
259
]
255
260
assert (
256
- find_increment_by_callable (commit_messages , get_increment )
261
+ SemVerIncrement . get_highest_by_messages (commit_messages , get_increment )
257
262
== SemVerIncrement .MINOR
258
263
)
259
264
@@ -263,7 +268,7 @@ def test_commit_with_scope(self, get_increment):
263
268
"fix(ui): fix button alignment" ,
264
269
]
265
270
assert (
266
- find_increment_by_callable (commit_messages , get_increment )
271
+ SemVerIncrement . get_highest_by_messages (commit_messages , get_increment )
267
272
== SemVerIncrement .MINOR
268
273
)
269
274
@@ -393,7 +398,7 @@ def test_with_find_increment_by_callable(self, custom_bump_rule):
393
398
"docs: update readme [MINOR]" ,
394
399
]
395
400
assert (
396
- find_increment_by_callable (
401
+ SemVerIncrement . get_highest_by_messages (
397
402
commit_messages , lambda x : custom_bump_rule .get_increment (x , False )
398
403
)
399
404
== SemVerIncrement .MAJOR
@@ -577,7 +582,7 @@ def test_with_find_increment_by_callable(self, custom_bump_rule):
577
582
"perf: improve performance" ,
578
583
]
579
584
assert (
580
- find_increment_by_callable (
585
+ SemVerIncrement . get_highest_by_messages (
581
586
commit_messages , lambda x : custom_bump_rule .get_increment (x , False )
582
587
)
583
588
== SemVerIncrement .MAJOR
0 commit comments