This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Todd.Rovito
Recipients David.Benjamin, Todd.Rovito, asvetlov, chris.jerdonek, docs@python
Date 2012-11-05.04:09:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1352088571.95.0.37799156305.issue16278@psf.upfronthosting.co.za>
In-reply-to
Content
Attached is a patch for 16 test cases.  All 16 test cases have been tested on Windows 7, Mac OS X, and Linux they seem to function well.  Before this patch there was only a single test case for rename.  For each test case I used "unittest.skipUnless" to make sure the platform was one of the three that I tested for Windows 7, Mac OS X, or Linux.  These test cases demonstrate that the documentation is incorrect and perhaps a little fuzzy.  I plan to submit updates to the documentation in the coming days.  This patch is only for Python 3.4 but I will backport to 2.7 in a few days.  


I wrote the following code to find all the combinations based on parameters of the function:

src = ['src_file','src_directory_empty', 'src_directory_not_empty', \
       'src_file_or_directory_not_exist']
dst = ['dst_file_exist','dst_not_exist','dst_directory_empty', \
        'dst_directory_not_empty']

print "Make sure you have functions in test_os for all of these"
for index_src in range(0, len(src)):
    for index_dst in range(0, len(dst)):
        function_name = "test_rename_" + src[index_src] + "_" + \
            dst[index_dst]
        print function_name
History
Date User Action Args
2012-11-05 04:09:33Todd.Rovitosetrecipients: + Todd.Rovito, asvetlov, chris.jerdonek, docs@python, David.Benjamin
2012-11-05 04:09:31Todd.Rovitosetmessageid: <1352088571.95.0.37799156305.issue16278@psf.upfronthosting.co.za>
2012-11-05 04:09:31Todd.Rovitolinkissue16278 messages
2012-11-05 04:09:30Todd.Rovitocreate