@@ -321,3 +321,29 @@ def test_ignore_nonsemver_tag(repo: GitRepo) -> None:
321
321
expected_prev_tag = None ,
322
322
expected_commits = [commit_c , commit_b , commit_a ],
323
323
)
324
+
325
+
326
+ def test_untyped_commits (repo : GitRepo ) -> None :
327
+ """Test capture of untyped (i.e. uncategorizable) commits.
328
+
329
+ Parameters:
330
+ repo: GitRepo to a temporary repository.
331
+ """
332
+ commit_a = repo .first_hash
333
+ commit_b = repo .commit ("this commit is untyped and therefore does not have a section!" )
334
+ repo .tag ("1.0.0" )
335
+ changelog = Changelog (repo .path , convention = AngularConvention )
336
+ assert len (changelog .versions_list ) == 1
337
+ version , = changelog .versions_list
338
+ assert len (version .sections_list ) == 2
339
+ typed_sections = changelog .versions_dict [version .tag ].typed_sections
340
+ assert len (typed_sections ) == 1
341
+ untyped = changelog .versions_dict [version .tag ].untyped_section
342
+ assert untyped is not None
343
+ typed , = typed_sections
344
+ assert len (untyped .commits ) == 1
345
+ assert len (typed .commits ) == 1
346
+ untyped_commit , = untyped .commits
347
+ typed_commit , = typed .commits
348
+ assert untyped_commit .hash == commit_b
349
+ assert typed_commit .hash == commit_a
0 commit comments