Changeset 7496 for main


Ignore:
Timestamp:
20 Jan 2012, 14:00:39 (13 years ago)
Author:
uli
Message:

Be more careful when testing directory removals: do that in a safe
location or the complete src/ tree might be erazed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/utils/helpers.txt

    r7321 r7496  
    1616
    1717     >>> import os
     18     >>> import tempfile
     19     >>> old_location = os.getcwd()
     20     >>> new_location = tempfile.mkdtemp()
     21     >>> os.chdir(new_location)
     22
    1823     >>> from waeup.sirp.utils.helpers import remove_file_or_directory
    1924     >>> open('blah', 'wb').write('nonsense')
     
    151156Clean up:
    152157
    153     >>> remove_file_or_directory('src')
    154     >>> remove_file_or_directory('dst')
     158    >>> import shutil
     159    >>> shutil.rmtree(new_location)
     160    >>> os.chdir(old_location)
     161   
    155162
    156163
Note: See TracChangeset for help on using the changeset viewer.