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

Unified Diff: py/utils/gs_utils_manualtest.py

Issue 661563002: Add does_storage_object_exist to gs_utils (Closed) Base URL: https://skia.googlesource.com/common.git@master
Patch Set: Work harder to find .boto Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« py/utils/gs_utils.py ('K') | « py/utils/gs_utils.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: py/utils/gs_utils_manualtest.py
diff --git a/py/utils/gs_utils_manualtest.py b/py/utils/gs_utils_manualtest.py
index 3365055d0d140c32e97dfe4c48991da0980a612a..2ba63e4ccf59b717f9ade4d2924fe3bbbb3d3c37 100755
--- a/py/utils/gs_utils_manualtest.py
+++ b/py/utils/gs_utils_manualtest.py
@@ -388,6 +388,17 @@ def _test_dir_upload_and_download():
path=posixpath.join(remote_dir, subdir, filename))
+def _test_does_storage_object_exist():
+ gs = gs_utils.GSUtils()
+ cases = (('gs_utils_manualtest/4843645167453050644/subdir/file1', True),
+ ('gs_utils_manualtest', True),
+ ('bogus', False))
+ for obj, expect in cases:
+ msg = 'expected exists(%s) to be %s' % (
+ '/'.join(('gs:/', TEST_BUCKET, obj)), expect)
+ assert gs.does_storage_object_exist(TEST_BUCKET, obj) == expect, msg
+
+
if __name__ == '__main__':
_test_static_methods()
_test_upload_if_multiple_files()
@@ -395,5 +406,6 @@ if __name__ == '__main__':
_test_public_read()
_test_authenticated_round_trip()
_test_dir_upload_and_download()
+ _test_does_storage_object_exist()
# TODO(epoger): Add _test_unauthenticated_access() to make sure we raise
# an exception when we try to access without needed credentials.
« py/utils/gs_utils.py ('K') | « py/utils/gs_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698