Sha256: 4de2569282e3767caf439df657d9bb8a3c6002fb3dbeb8b94023df545096aeba

Contents?: true

Size: 1.89 KB

Versions: 4

Compression:

Stored size: 1.89 KB

Contents

# 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))

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
googlecloud-0.0.7 packages/gsutil/gslib/tests/test_setversioning.py
gcloud-0.0.7 packages/gsutil/gslib/tests/test_setversioning.py
googlecloud-0.0.6 packages/gsutil/gslib/tests/test_setversioning.py
gcloud-0.0.6 packages/gsutil/gslib/tests/test_setversioning.py