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

Unified Diff: tools/telemetry/third_party/gsutilz/gslib/tests/test_rm.py

Issue 1376593003: Roll gsutil version to 4.15. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
Index: tools/telemetry/third_party/gsutilz/gslib/tests/test_rm.py
diff --git a/tools/telemetry/third_party/gsutilz/gslib/tests/test_rm.py b/tools/telemetry/third_party/gsutilz/gslib/tests/test_rm.py
index d4fc41164543aedc9d41df5432ac5cfadd15c257..06651a471de15c09020a60a845039f8e374f40df 100644
--- a/tools/telemetry/third_party/gsutilz/gslib/tests/test_rm.py
+++ b/tools/telemetry/third_party/gsutilz/gslib/tests/test_rm.py
@@ -435,9 +435,8 @@ class TestRm(testcase.GsUtilIntegrationTestCase):
ouri1 = self.CreateObject(bucket_uri=buri1,
object_name='foo',
contents='foocontents')
- ouri2 = self.CreateObject(bucket_uri=buri1,
- object_name='bar',
- contents='barcontents')
+ self.CreateObject(bucket_uri=buri1, object_name='bar',
+ contents='barcontents')
ouri3 = self.CreateObject(bucket_uri=buri1,
object_name='baz',
contents='bazcontents')
@@ -457,3 +456,19 @@ class TestRm(testcase.GsUtilIntegrationTestCase):
stdin=stdin)
self.AssertNObjectsInBucket(buri1, 1, versioned=True)
self.AssertNObjectsInBucket(buri2, 0, versioned=True)
+
+ def test_rm_nonexistent_bucket_recursive(self):
+ stderr = self.RunGsUtil(
+ ['rm', '-rf', '%s://%s' % (self.default_provider,
+ self.nonexistent_bucket_name)],
+ return_stderr=True, expected_status=1)
+ self.assertIn('Encountered non-existent bucket', stderr)
+
+ def test_rm_multiple_nonexistent_objects(self):
+ bucket_uri = self.CreateBucket()
+ nonexistent_object1 = suri(bucket_uri, 'nonexistent1')
+ nonexistent_object2 = suri(bucket_uri, 'nonexistent1')
+ stderr = self.RunGsUtil(
+ ['rm', '-rf', nonexistent_object1, nonexistent_object2],
+ return_stderr=True, expected_status=1)
+ self.assertIn('2 files/objects could not be removed.', stderr)

Powered by Google App Engine
This is Rietveld 408576698