@@ -124,6 +124,26 @@ def test_extract_added_lines_only_changelog_has_added(self):
124124 '''
125125 self .assertEqual (validate_changelog_utils .extract_added_lines (diff ), expected )
126126
127+ def test_extract_added_lines_only_changelog_has_added_with_blank_lines (self ):
128+ expected = {
129+ "CHANGELOG.md" : ['- Added third unreleased feature. [#6050](https://github.com/mapbox/mapbox-navigation-android/pull/6050)' ]
130+ }
131+ diff = '''diff --git a/CHANGELOG.md b/CHANGELOG.md
132+ --- a/CHANGELOG.md (revision fca6af9072a1b6cb7263460f7c3270e48bffed07)
133+ +++ b/CHANGELOG.md (date 1659101777554)
134+ @@ -6,6 +6,7 @@
135+ #### Features
136+ - Added first unreleased feature. [#6049](https://github.com/mapbox/mapbox-navigation-android/pull/6049)
137+ - Added second unreleased feature. [#6048](https://github.com/mapbox/mapbox-navigation-android/pull/6048)
138+ +- Added third unreleased feature. [#6050](https://github.com/mapbox/mapbox-navigation-android/pull/6050)
139+ +
140+ +
141+
142+ #### Bug fixes and improvements
143+ - Fixed first unreleased bug. [#6047](https://github.com/mapbox/mapbox-navigation-android/pull/6047)
144+ '''
145+ self .assertEqual (validate_changelog_utils .extract_added_lines (diff ), expected )
146+
127147 def test_extract_added_lines_only_changelog_with_path_has_added (self ):
128148 expected = {
129149 "libnavui-androidauto/CHANGELOG.md" : ['- Added third unreleased feature. [#6050](https://github.com/mapbox/mapbox-navigation-android/pull/6050)' ]
@@ -642,6 +662,27 @@ def test_check_version_section_single_line_repeats_unstable_version(self):
642662 added_lines = ['- Added first feature to 2.7.0-beta1. [#6045](https://github.com/mapbox/mapbox-navigation-android/pull/6045)' ]
643663 validate_changelog_utils .check_version_section (content , added_lines )
644664
665+ def test_check_for_duplications_empty_list (self ):
666+ validate_changelog_utils .check_for_duplications ([])
667+
668+ def test_check_for_duplications_single_unique_element (self ):
669+ added_lines = ['- Line 1' ]
670+ validate_changelog_utils .check_for_duplications (added_lines )
671+
672+ def test_check_for_duplications_single_repeated_element (self ):
673+ added_lines = ['- Line 1' , '- Line 1' ]
674+ with self .assertRaises (Exception ):
675+ validate_changelog_utils .check_for_duplications (added_lines )
676+
677+ def test_check_for_duplications_multiple_unique_elements (self ):
678+ added_lines = ['- Line 1' , '- Line 2' , '- Line 3' ]
679+ validate_changelog_utils .check_for_duplications (added_lines )
680+
681+ def test_check_for_duplications_multiple_elements_with_repeated (self ):
682+ added_lines = ['- Line 1' , '- Line 2' , '- Line 3' , '- Line 2' ]
683+ with self .assertRaises (Exception ):
684+ validate_changelog_utils .check_for_duplications (added_lines )
685+
645686 def read_test_changelog (self , filename ):
646687 script_dir = os .path .dirname (__file__ )
647688 rel_path = "test_resources/" + filename
0 commit comments