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

Side by Side 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, 9 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
OLDNEW
(Empty)
1 # Copyright 2013 Google Inc. All Rights Reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 import gslib.tests.testcase as testcase
16 from gslib.tests.util import ObjectToURI as suri
17
18
19 class TestSetVersioning(testcase.GsUtilIntegrationTestCase):
20 """Integration tests for setversioning command."""
21
22 def test_off_default(self):
23 bucket_uri = self.CreateBucket()
24 stdout = self.RunGsUtil(['getversioning',
25 suri(bucket_uri)], return_stdout=True)
26 self.assertEqual(stdout.strip(), '%s: Suspended' % suri(bucket_uri))
27
28 def test_turning_on(self):
29 bucket_uri = self.CreateBucket()
30 self.RunGsUtil(['setversioning', 'on', suri(bucket_uri)])
31 stdout = self.RunGsUtil(['getversioning',
32 suri(bucket_uri)], return_stdout=True)
33 self.assertEqual(stdout.strip(), '%s: Enabled' % suri(bucket_uri))
34
35 def test_turning_off(self):
36 bucket_uri = self.CreateBucket()
37 self.RunGsUtil(['setversioning', 'on', suri(bucket_uri)])
38 stdout = self.RunGsUtil(['getversioning',
39 suri(bucket_uri)], return_stdout=True)
40 self.assertEqual(stdout.strip(), '%s: Enabled' % suri(bucket_uri))
41 self.RunGsUtil(['setversioning', 'off', suri(bucket_uri)])
42 stdout = self.RunGsUtil(['getversioning',
43 suri(bucket_uri)], return_stdout=True)
44 self.assertEqual(stdout.strip(), '%s: Suspended' % suri(bucket_uri))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698