#NEWLINE# def test_python_import_parser( ) : #NEWLINE# #INDENT# parser = PythonImportCount ( ) #NEWLINE# input_stats = [ FileDiffStat ( b'test.py' , [ b'import collections' , b'from os import path' ] , [ b'import os.path' , b'nothing' ] , None ) ] #NEWLINE# metrics = list ( parser . get_metrics_from_stat ( input_stats ) ) #NEWLINE# assert ( input_stats == [ Metric ( 'PythonImportCount' , 1 ) ] )