Пример #1
0
 def test_get_commit_details(self):
     git_executor = MockGitExecutor('''log --show-notes=test-ref -n 1 --pretty=format:"hash,%H,shorthash,%h,commiter,%an <%ae>,date,%at|__NOTE__|%N" 1111''',
         ['hash,1111,shorthash,2222,commiter,Unit Test <*****@*****.**>,date,1371047821|__NOTE__|test note'])
     git_utils = GitUtils(git_executor)
     commit_details = git_utils.get_commit_details('test-ref', '1111')
     expected_details = {'date': '1371047821', 'note': 'test note', 'commiter': 'Unit Test <*****@*****.**>', 'shorthash': '2222', 'hash': '1111'};
     self.assertDictEqual(expected_details, commit_details)
Пример #2
0
 def __generate_data_points(self, log: Logger, metrics, git: GitUtils):
     for x in list(self.__generate_data_points_for_last_commits(log, git))[-99:]:
         yield x
     yield self.__generate_data_point_for_commit(metrics.__dict__, git.get_commit_details(STATS_REF_NAME), log)
Пример #3
0
 def __generate_data_points(self, log: Logger, metrics, git: GitUtils):
     for x in list(self.__generate_data_points_for_last_commits(log,
                                                                git))[-99:]:
         yield x
     yield self.__generate_data_point_for_commit(
         metrics.__dict__, git.get_commit_details(STATS_REF_NAME), log)