Browse code

Fix error message to be accurate with all cases + Fixed auto tests for last change.

Florent Viard authored on 2017/06/12 07:45:34
Showing 3 changed files
... ...
@@ -266,7 +266,7 @@ def test_curl_HEAD(label, src_file, **kwargs):
266 266
     cmd.append(src_file)
267 267
     return test(label, cmd, **kwargs)
268 268
 
269
-bucket_prefix = u"%s-" % getpass.getuser()
269
+bucket_prefix = u"%s-" % getpass.getuser().lower()
270 270
 
271 271
 argv = sys.argv[1:]
272 272
 while argv:
... ...
@@ -594,7 +594,7 @@ test_s3cmd("Copy between buckets", ['cp', '%s/xyz/etc2/Logo.PNG' % pbucket(1), '
594 594
     must_find = [ "remote copy: '%s/xyz/etc2/Logo.PNG' -> '%s/xyz/etc2/logo.png'" % (pbucket(1), pbucket(3)) ])
595 595
 
596 596
 ## ====== Recursive copy
597
-test_s3cmd("Recursive copy, set ACL", ['cp', '-r', '--acl-public', '%s/xyz/' % pbucket(1), '%s/copy' % pbucket(2), '--exclude', 'demo/dir?/*.txt', '--exclude', 'non-printables*'],
597
+test_s3cmd("Recursive copy, set ACL", ['cp', '-r', '--acl-public', '%s/xyz/' % pbucket(1), '%s/copy/' % pbucket(2), '--exclude', 'demo/dir?/*.txt', '--exclude', 'non-printables*'],
598 598
     must_find = [ "remote copy: '%s/xyz/etc2/Logo.PNG' -> '%s/copy/etc2/Logo.PNG'" % (pbucket(1), pbucket(2)),
599 599
                   "remote copy: '%s/xyz/blahBlah/Blah.txt' -> '%s/copy/blahBlah/Blah.txt'" % (pbucket(1), pbucket(2)),
600 600
                   "remote copy: '%s/xyz/blahBlah/blah.txt' -> '%s/copy/blahBlah/blah.txt'" % (pbucket(1), pbucket(2)) ],
... ...
@@ -582,7 +582,7 @@ test_s3cmd("Copy between buckets", ['cp', '%s/xyz/etc2/Logo.PNG' % pbucket(1), '
582 582
     must_find = [ "remote copy: '%s/xyz/etc2/Logo.PNG' -> '%s/xyz/etc2/logo.png'" % (pbucket(1), pbucket(3)) ])
583 583
 
584 584
 ## ====== Recursive copy
585
-test_s3cmd("Recursive copy, set ACL", ['cp', '-r', '--acl-public', '%s/xyz/' % pbucket(1), '%s/copy' % pbucket(2), '--exclude', 'demo/dir?/*.txt', '--exclude', 'non-printables*'],
585
+test_s3cmd("Recursive copy, set ACL", ['cp', '-r', '--acl-public', '%s/xyz/' % pbucket(1), '%s/copy/' % pbucket(2), '--exclude', 'demo/dir?/*.txt', '--exclude', 'non-printables*'],
586 586
     must_find = [ "remote copy: '%s/xyz/etc2/Logo.PNG' -> '%s/copy/etc2/Logo.PNG'" % (pbucket(1), pbucket(2)),
587 587
                   "remote copy: '%s/xyz/blahBlah/Blah.txt' -> '%s/copy/blahBlah/Blah.txt'" % (pbucket(1), pbucket(2)),
588 588
                   "remote copy: '%s/xyz/blahBlah/blah.txt' -> '%s/copy/blahBlah/blah.txt'" % (pbucket(1), pbucket(2)) ],
... ...
@@ -817,7 +817,7 @@ def subcmd_cp_mv(args, process_fce, action_str, message):
817 817
         # Trying to mv dir1/ to dir2 will not pass a test in S3.FileLists,
818 818
         # so we don't need to test for it here.
819 819
         if len(remote_list) > 1 or cfg.recursive:
820
-           raise ParameterError("Destination must be a directory and end with '/' when acting on multiple sources.")
820
+           raise ParameterError("Destination must be a directory and end with '/' when acting on a folder content or on multiple sources.")
821 821
 
822 822
     if cfg.recursive:
823 823
         for key in remote_list: