]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - src/allmydata/test/test_cli_cp.py
cp: trailing slash on source filename is an error, just like on targets
[tahoe-lafs/tahoe-lafs.git] / src / allmydata / test / test_cli_cp.py
index 24087a4f49f00325b194dbb77746e02ef92430da..03abcc4595cb344122ecec23b2b1fe68e462d369 100644 (file)
@@ -660,7 +660,7 @@ starting copy, 2 files, 1 directories
 # trailing slash on target *directory* should not matter, test both
 # trailing slash on target files should cause error
 # trailing slash on source directory should not matter, test a few
-# ignore trailing slash on source file, that's easiest
+# trailing slash on source files should cause error
 
 COPYOUT_TESTCASES = """
 cp    $FILECAP          to/existing-file : to/existing-file
@@ -686,12 +686,12 @@ cp    $FILECAP        to : E2-DESTNAME
 cp -r $FILECAP        to : E2-DESTNAME
 cp    $DIRCAP/file    to : to/file
 cp -r $DIRCAP/file    to : to/file
-# these two should behave like the two above: ignore trailing slash
-cp    $DIRCAP/file/   to : to/file
-cp -r $DIRCAP/file/   to : to/file
+# these two are errors
+cp    $DIRCAP/file/   to : E8-BADSLASH
+cp -r $DIRCAP/file/   to : E8-BADSLASH
 cp    $PARENTCAP/dir  to : E4-NEED-R
 cp -r $PARENTCAP/dir  to : to/dir/file
-# these two should ignore the trailing source slash too
+# but these two should ignore the trailing source slash
 cp    $PARENTCAP/dir/ to : E4-NEED-R
 cp -r $PARENTCAP/dir/ to : to/dir/file
 cp    $DIRCAP         to : E4-NEED-R
@@ -949,6 +949,8 @@ class CopyOut(GridTestMixin, CLITestMixin, unittest.TestCase):
                     return set(["E6-MANYONE"])
                 if err == "target is not a directory, but ends with a slash":
                     return set(["E7-BADSLASH"])
+                if err == "source is not a directory, but ends with a slash":
+                    return set(["E8-BADSLASH"])
             self.fail("unrecognized error ('%s') %s" % (case, res))
         d.addCallback(_check)
         return d