Stubs calls to purge_directory and remove_directory in unit tests