Creating a list of stress tests for unit tests involving files

python at bdurham.com python at bdurham.com
Wed Jun 9 17:30:54 EDT 2010


I'm working on a set of unit tests designed to stress test some
file handling capabilities of our application.

Listed below are some file names designed to cause failures when
used with open/codecs.open and with the os/shutil module file
functions. Can anyone think of additional scenarios (path names
or unusual file access) that we could test against? My tests will
initially be for the Windows platform (2000-Windows 7), but I
would welcome Linux and/or Mac specific failure conditions as
well.

UNITTEST_DRIVE_NOT_READY = r'a:'
UNITTEST_DRIVE_READ_ONLY = r'g:'  # CD drive with CD
UNITTEST_UNC_NOT_EXIST   = r'\\unc_not_exist'
UNITTEST_FILE_BAD_CHARS  = r'path_bad_chars_*<>|'
UNITTEST_FILE_NO_WRITE  = r'c:\program files'
UNITTEST_FILE_NOT_EXIST  = r'\path_not_exist'
UNITTEST_FILE_LOCKED     = r'file_locked.tmp'
unittest_file_locked     = open( UNITTEST_FILE_LOCKED, 'w' )
UNITTEST_UNICODE_PATH    = ur'\xunicode_test_\xb0_\xb1_'

Thank you,
Malcolm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100609/20c23bd1/attachment.html>


More information about the Python-list mailing list