#NEWLINE# def test_lines_of_code_parser( ) : #NEWLINE# #INDENT# parser = LinesOfCodeParser ( ) #NEWLINE# input_stats = [ FileDiffStat ( b'test.py' , [ b'a' ] , [ ] , None ) , FileDiffStat ( b'womp.yaml' , [ b'a' , b'b' , b'c' ] , [ b'hi' ] , None ) ] #NEWLINE# metrics = list ( parser . get_metrics_from_stat ( input_stats ) ) #NEWLINE# expected_value = { #NEWLINE# #INDENT# 'TotalLinesOfCode' : 3 , #NEWLINE# 'TotalLinesOfCode_Python' : 1 , #NEWLINE# 'TotalLinesOfCode_Yaml' : 2 , #NEWLINE# #UNINDENT# } #NEWLINE# for metric in metrics : #NEWLINE# #INDENT# assert ( metric . value == expected_value . get ( metric . name , 0 ) )