#NEWLINE# def test_orphaned_files( self ) : #NEWLINE# #INDENT# clean = Clean ( ) #NEWLINE# walk_ret = ( ( 'daguerre' , [ 'test' ] , [ ] ) , ( 'daguerre/test' , [ ] , [ 'fake1.png' , 'fake2.png' , 'fake3.png' ] ) ) #NEWLINE# AdjustedImage . objects . create ( requested = 'fit|50|50' , storage_path = 'whatever.png' , adjusted = 'daguerre/test/fake2.png' ) #NEWLINE# with mock . patch . object ( clean , '_walk' , return_value = walk ) as walk : #NEWLINE# #INDENT# self . assertEqual ( clean . _orphaned_files ( ) , [ 'daguerre/test/fake1.png' , 'daguerre/test/fake3.png' ] ) #NEWLINE# walk . assert_called_once_with ( 'daguerre' , topdown = False )