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

Unified Diff: third_party/gsutil/gslib/tests/test_setversioning.py

Issue 12317103: Added gsutil to depot tools (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: added readme Created 7 years, 10 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: third_party/gsutil/gslib/tests/test_setversioning.py
diff --git a/third_party/gsutil/gslib/tests/test_setversioning.py b/third_party/gsutil/gslib/tests/test_setversioning.py
new file mode 100644
index 0000000000000000000000000000000000000000..ae2868490bc17dcd61dac9687847ba1ae97b1a85
--- /dev/null
+++ b/third_party/gsutil/gslib/tests/test_setversioning.py
@@ -0,0 +1,44 @@
+# Copyright 2013 Google Inc. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import gslib.tests.testcase as testcase
+from gslib.tests.util import ObjectToURI as suri
+
+
+class TestSetVersioning(testcase.GsUtilIntegrationTestCase):
+ """Integration tests for setversioning command."""
+
+ def test_off_default(self):
+ bucket_uri = self.CreateBucket()
+ stdout = self.RunGsUtil(['getversioning',
+ suri(bucket_uri)], return_stdout=True)
+ self.assertEqual(stdout.strip(), '%s: Suspended' % suri(bucket_uri))
+
+ def test_turning_on(self):
+ bucket_uri = self.CreateBucket()
+ self.RunGsUtil(['setversioning', 'on', suri(bucket_uri)])
+ stdout = self.RunGsUtil(['getversioning',
+ suri(bucket_uri)], return_stdout=True)
+ self.assertEqual(stdout.strip(), '%s: Enabled' % suri(bucket_uri))
+
+ def test_turning_off(self):
+ bucket_uri = self.CreateBucket()
+ self.RunGsUtil(['setversioning', 'on', suri(bucket_uri)])
+ stdout = self.RunGsUtil(['getversioning',
+ suri(bucket_uri)], return_stdout=True)
+ self.assertEqual(stdout.strip(), '%s: Enabled' % suri(bucket_uri))
+ self.RunGsUtil(['setversioning', 'off', suri(bucket_uri)])
+ stdout = self.RunGsUtil(['getversioning',
+ suri(bucket_uri)], return_stdout=True)
+ self.assertEqual(stdout.strip(), '%s: Suspended' % suri(bucket_uri))

Powered by Google App Engine
This is Rietveld 408576698