def log_header(self): """ Output a header to the log. """ self.log( f'T3 execution initiated on {time.asctime()}\n\n' f'################################################################\n' f'# #\n' f'# APIOxy #\n' f'# #\n' f'# Version: {VERSION}{" " * (10 - len(VERSION))} #\n' f'# #\n' f'################################################################\n\n', level='always') # Extract HEAD git commit from T3 head, date = get_git_commit(path=apioxy_path) branch_name = get_git_branch(path=apioxy_path) if head != '' and date != '': self.log( f'The current git HEAD for APIOxy is:\n' f' {head}\n {date}', level='always') if branch_name and branch_name != 'master': self.log(f' (running on the {branch_name} branch)\n', level='always') else: self.log('\n', level='always') self.log(f'Starting project {self.project}', level='always')
def log_header(self): """ Output a header to the log. """ self.log( f'T3 execution initiated on {time.asctime()}\n\n' f'################################################################\n' f'# #\n' f'# The Tandem Tool (T3) #\n' f'# Automated kinetic model generation and refinement #\n' f'# #\n' f'# Version: {VERSION}{" " * (10 - len(VERSION))} #\n' f'# #\n' f'################################################################\n\n', level='always') # Extract HEAD git commit from T3 head, date = get_git_commit(path=t3_path) branch_name = get_git_branch(path=t3_path) if head != '' and date != '': self.log( f'The current git HEAD for T3 is:\n' f' {head}\n {date}', level='always') if branch_name and branch_name != 'main': self.log(f' (running on the {branch_name} branch)\n', level='always') else: self.log('\n', level='always') self.log(f'Starting project {self.project}', level='always')
def test_get_git_commit(self): """Test the get_git_commit() function""" git_commit = common.get_git_commit() # output format: ['fafdb957049917ede565cebc58b29899f597fb5a', 'Fri Mar 29 11:09:50 2019 -0400'] self.assertEqual(len(git_commit[0]), 40) self.assertEqual(len(git_commit[1].split()), 6) self.assertIsInstance(git_commit[0], str) self.assertIsInstance(git_commit[1], str)