| OLD | NEW |
| 1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
| 2 # Copyright 2014 Google Inc. All Rights Reserved. | 2 # Copyright 2014 Google Inc. All Rights Reserved. |
| 3 # | 3 # |
| 4 # Licensed under the Apache License, Version 2.0 (the "License"); | 4 # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 # you may not use this file except in compliance with the License. | 5 # you may not use this file except in compliance with the License. |
| 6 # You may obtain a copy of the License at | 6 # You may obtain a copy of the License at |
| 7 # | 7 # |
| 8 # http://www.apache.org/licenses/LICENSE-2.0 | 8 # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 # | 9 # |
| 10 # Unless required by applicable law or agreed to in writing, software | 10 # Unless required by applicable law or agreed to in writing, software |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 return_stderr=True) | 37 return_stderr=True) |
| 38 self.assertIn('BucketNotEmpty', stderr) | 38 self.assertIn('BucketNotEmpty', stderr) |
| 39 | 39 |
| 40 def test_rb_versioned_bucket_not_empty(self): | 40 def test_rb_versioned_bucket_not_empty(self): |
| 41 bucket_uri = self.CreateVersionedBucket(test_objects=1) | 41 bucket_uri = self.CreateVersionedBucket(test_objects=1) |
| 42 stderr = self.RunGsUtil(['rb', suri(bucket_uri)], expected_status=1, | 42 stderr = self.RunGsUtil(['rb', suri(bucket_uri)], expected_status=1, |
| 43 return_stderr=True) | 43 return_stderr=True) |
| 44 self.assertIn('Bucket is not empty. Note: this is a versioned bucket', | 44 self.assertIn('Bucket is not empty. Note: this is a versioned bucket', |
| 45 stderr) | 45 stderr) |
| 46 | 46 |
| 47 def test_rb_nonexistent_bucket(self): |
| 48 stderr = self.RunGsUtil(['rb', 'gs://%s' % self.nonexistent_bucket_name], |
| 49 return_stderr=True, expected_status=1) |
| 50 self.assertIn('does not exist.', stderr) |
| 51 |
| 47 def test_rb_minus_f(self): | 52 def test_rb_minus_f(self): |
| 48 bucket_uri = self.CreateBucket() | 53 bucket_uri = self.CreateBucket() |
| 49 stderr = self.RunGsUtil([ | 54 stderr = self.RunGsUtil([ |
| 50 'rb', '-f', 'gs://%s' % self.nonexistent_bucket_name, | 55 'rb', '-f', 'gs://%s' % self.nonexistent_bucket_name, |
| 51 suri(bucket_uri)], return_stderr=True, expected_status=1) | 56 suri(bucket_uri)], return_stderr=True, expected_status=1) |
| 52 # There should be no error output, and existing bucket named after | 57 # There should be no error output, and existing bucket named after |
| 53 # non-existent bucket should be gone. | 58 # non-existent bucket should be gone. |
| 54 self.assertNotIn('bucket does not exist.', stderr) | 59 self.assertNotIn('bucket does not exist.', stderr) |
| 55 stderr = self.RunGsUtil( | 60 stderr = self.RunGsUtil( |
| 56 ['ls', '-Lb', suri(bucket_uri)], return_stderr=True, expected_status=1) | 61 ['ls', '-Lb', suri(bucket_uri)], return_stderr=True, expected_status=1) |
| 57 self.assertIn('404', stderr) | 62 self.assertIn('404', stderr) |
| OLD | NEW |