Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: py/utils/gs_utils_manualtest.py

Issue 424553002: upload_dir_contents(): upload multiple files in parallel (Closed) Base URL: https://skia.googlesource.com/common.git@master
Patch Set: add DEFAULT_UPLOAD_THREADS Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « py/utils/gs_utils.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 """Tests for gs_utils.py. 3 """Tests for gs_utils.py.
4 4
5 TODO(epoger): How should we exercise these self-tests? See http://skbug.com/2751 5 TODO(epoger): How should we exercise these self-tests? See http://skbug.com/2751
6 """ 6 """
7 7
8 # System-level imports. 8 # System-level imports.
9 import logging
9 import os 10 import os
10 import posixpath 11 import posixpath
11 import random 12 import random
12 import shutil 13 import shutil
13 import sys 14 import sys
14 import tempfile 15 import tempfile
15 import time 16 import time
16 17
17 # Local imports. 18 # Local imports.
18 import gs_utils 19 import gs_utils
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 assert file_contents == 'contents of %s\n' % filename, ( 349 assert file_contents == 'contents of %s\n' % filename, (
349 '%s == "contents of %s\n"' % (file_contents, filename)) 350 '%s == "contents of %s\n"' % (file_contents, filename))
350 finally: 351 finally:
351 shutil.rmtree(local_dest_dir) 352 shutil.rmtree(local_dest_dir)
352 for filename in filenames: 353 for filename in filenames:
353 gs.delete_file(bucket=TEST_BUCKET, 354 gs.delete_file(bucket=TEST_BUCKET,
354 path=posixpath.join(remote_dir, subdir, filename)) 355 path=posixpath.join(remote_dir, subdir, filename))
355 356
356 357
357 if __name__ == '__main__': 358 if __name__ == '__main__':
359 logging.basicConfig(level=logging.INFO)
358 _test_upload_if_multiple_files() 360 _test_upload_if_multiple_files()
359 _test_upload_if_one_file() 361 _test_upload_if_one_file()
360 _test_public_read() 362 _test_public_read()
361 _test_authenticated_round_trip() 363 _test_authenticated_round_trip()
362 _test_dir_upload_and_download() 364 _test_dir_upload_and_download()
363 # TODO(epoger): Add _test_unauthenticated_access() to make sure we raise 365 # TODO(epoger): Add _test_unauthenticated_access() to make sure we raise
364 # an exception when we try to access without needed credentials. 366 # an exception when we try to access without needed credentials.
OLDNEW
« no previous file with comments | « py/utils/gs_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698