<s> import unittest <EOL> from commit_entropy . parser . git_log_parser import GitLogParser <EOL> from datetime import datetime , timezone , timedelta <EOL> class GitLogParserTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . commit_line_without_commit_keyword = '<STR_LIT>' <EOL> self . author_line = '<STR_LIT>' <EOL> self . date_line = '<STR_LIT>' <EOL> self . file_line = '<STR_LIT>' <EOL> self . ignored_file_line = '<STR_LIT>' <EOL> self . ignored_merge_line = '<STR_LIT>' <EOL> self . ignored_comment_line = '<STR_LIT>' <EOL> self . ignored_line = '<STR_LIT>' <EOL> self . complete_commit = """<STR_LIT>""" . strip ( ) <EOL> self . parser = GitLogParser ( ) <EOL> def parse_test ( self ) : <EOL> """<STR_LIT>""" <EOL> self . assertEqual ( <EOL> [ <EOL> { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:date>' : datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:12> , <NUM_LIT> , <NUM_LIT> , tzinfo = timezone ( timedelta ( <NUM_LIT:0> , <NUM_LIT> ) ) ) , <EOL> '<STR_LIT:count>' : <NUM_LIT:4> , <EOL> } , <EOL> ] , <EOL> self . parser . parse ( self . complete_commit , ignore = [ "<STR_LIT>" ] ) <EOL> ) <EOL> def try_fetch_attribute_test ( self ) : <EOL> """<STR_LIT>""" <EOL> self . assertEqual ( <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> self . parser . try_fetch_attribute ( self . commit_line_without_commit_keyword ) <EOL> ) <EOL> self . assertEqual ( <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> self . parser . try_fetch_attribute ( self . author_line ) <EOL> ) <EOL> self . assertEqual ( <EOL> ( '<STR_LIT:date>' , datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:12> , <NUM_LIT> , <NUM_LIT> , tzinfo = timezone ( timedelta ( <NUM_LIT:0> , <NUM_LIT> ) ) ) ) , <EOL> self . parser . try_fetch_attribute ( self . date_line ) <EOL> ) <EOL> self . assertEqual ( <EOL> ( '<STR_LIT:count>' , <NUM_LIT:1> ) , <EOL> self . parser . try_fetch_attribute ( self . file_line ) <EOL> ) <EOL> self . assertEqual ( <EOL> ( '<STR_LIT:count>' , <NUM_LIT:1> ) , <EOL> self . parser . try_fetch_attribute ( self . ignored_file_line ) <EOL> ) <EOL> self . assertEqual ( <EOL> None , <EOL> self . parser . try_fetch_attribute ( self . ignored_file_line , ignore = [ "<STR_LIT>" ] ) <EOL> ) <EOL> self . assertEqual ( None , self . parser . try_fetch_attribute ( self . ignored_merge_line ) ) <EOL> self . assertEqual ( None , self . parser . try_fetch_attribute ( self . ignored_comment_line ) ) <EOL> self . assertEqual ( None , self . parser . try_fetch_attribute ( self . ignored_line ) ) </s>
