#NEWLINE# def setUp( self ) : #NEWLINE# #INDENT# self . trashTopdir = mkdtemp ( prefix = 's2t' ) #NEWLINE# self . fileName = 'test.txt' #NEWLINE# self . filePath = op . join ( self . trashTopdir , self . fileName ) #NEWLINE# touch ( self . filePath ) #NEWLINE# self . old_ismount = old_ismount = op . ismount #NEWLINE# self . old_getdev = send2trash . plat_other . get_dev #NEWLINE# def s_getdev( path ) : #NEWLINE# #INDENT# from send2trash.plat_other import is_parent #NEWLINE# st = os . lstat ( path ) #NEWLINE# if is_parent ( self . trashTopdir , path ) : #NEWLINE# #INDENT# return 'dev' #NEWLINE# #UNINDENT# return st #NEWLINE# #UNINDENT# def s_ismount( path ) : #NEWLINE# #INDENT# if ( op . realpath ( path ) == op . realpath ( self . trashTopdir ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# return old_ismount ( path ) #NEWLINE# #UNINDENT# send2trash . plat_other . os . path . ismount = s_ismount #NEWLINE# send2trash . plat_other . get_dev = s_getdev