Ejemplo n.º 1
0
    def test_invalid_inner_type_for_list_of_commit_info(self):
        invalid_inner_types = (None, True, 14, 15.6, 'a', ('a', 'b'), {
            'a': 'b'
        }, {'a'})

        for inner_type in invalid_inner_types:
            with self.assertRaises(TypeError):
                git_changelog.truncate_changelog([inner_type], options())
Ejemplo n.º 2
0
 def test_disable_author(self):
     list_of_commit_info = create_list_of_commit_info(
         self.data_path('original/log.txt'))
     result_log = git_changelog.truncate_changelog(
         list_of_commit_info, options(disable_author=True))
     original_log = self.data('result/log_disable_author.txt',
                              codec='utf-8',
                              native_line_breaks=True)
     original_log = original_log.strip()
     self.assertEqual(original_log, result_log)
Ejemplo n.º 3
0
    def test_truncate_max_chars_200(self):
        list_of_commit_info = create_list_of_commit_info(
            self.data_path('original/log.txt'))

        result_log = git_changelog.truncate_changelog(list_of_commit_info,
                                                      options(max_chars=100))
        original_log = self.data('result/log_truncate_max_chars_100.txt',
                                 codec='utf-8',
                                 native_line_breaks=True)
        original_log = original_log.strip()
        self.assertEqual(original_log, result_log)
Ejemplo n.º 4
0
    def test_truncate_five_lines(self):
        list_of_commit_info = create_list_of_commit_info(
            self.data_path('original/log.txt'))

        for max_chars in range(1420, 1402, -1):
            result_log = git_changelog.truncate_changelog(
                list_of_commit_info, options(max_chars=max_chars))
            original_log = self.data('result/log_truncate_five_lines.txt',
                                     codec='utf-8',
                                     native_line_breaks=True)
            original_log = original_log.strip()
            self.assertEqual(original_log, result_log)