#NEWLINE# @ patch ( 'rerun.rerun.os' ) #NEWLINE# def test_get_file_mtime( self , mock_os ) : #NEWLINE# #INDENT# def mock_stat( filename ) : #NEWLINE# #INDENT# self . assertEqual ( filename , 'hello' ) #NEWLINE# return mock_filestat #NEWLINE# #UNINDENT# mock_os . lstat = mock_stat #NEWLINE# mock_filestat = { #NEWLINE# #INDENT# stat . ST_MTIME : 'mymtime' , #NEWLINE# #UNINDENT# } #NEWLINE# time = get_file_mtime ( 'hello' ) #NEWLINE# self . assertEqual ( mock_filestat , 'mymtime' )