Beispiel #1
0
    def test_that_when_putting_cors_succeeds_the_put_cors_method_returns_true(self):
        '''
        tests True bucket updated.
        '''
        result = boto_s3_bucket.put_cors(Bucket='mybucket', CORSRules='[]',
                                        **conn_parameters)

        self.assertTrue(result['updated'])
Beispiel #2
0
    def test_that_when_putting_cors_succeeds_the_put_cors_method_returns_true(self):
        '''
        tests True bucket updated.
        '''
        result = boto_s3_bucket.put_cors(Bucket='mybucket', CORSRules='[]',
                                        **conn_parameters)

        self.assertTrue(result['updated'])
Beispiel #3
0
 def test_that_when_putting_cors_fails_the_put_cors_method_returns_error(self):
     '''
     tests False bucket not updated.
     '''
     self.conn.put_bucket_cors.side_effect = ClientError(error_content,
                    'put_bucket_cors')
     result = boto_s3_bucket.put_cors(Bucket='mybucket', CORSRules='[]',
                                     **conn_parameters)
     self.assertEqual(result.get('error', {}).get('message'),
                     error_message.format('put_bucket_cors'))
Beispiel #4
0
 def test_that_when_putting_cors_fails_the_put_cors_method_returns_error(self):
     '''
     tests False bucket not updated.
     '''
     self.conn.put_bucket_cors.side_effect = ClientError(error_content,
                    'put_bucket_cors')
     result = boto_s3_bucket.put_cors(Bucket='mybucket', CORSRules='[]',
                                     **conn_parameters)
     self.assertEqual(result.get('error', {}).get('message'),
                     error_message.format('put_bucket_cors'))
    def test_that_when_putting_cors_succeeds_the_put_cors_method_returns_true(
            self):
        """
        tests True bucket updated.
        """
        result = boto_s3_bucket.put_cors(Bucket="mybucket",
                                         CORSRules="[]",
                                         **conn_parameters)

        self.assertTrue(result["updated"])
def test_that_when_putting_cors_fails_the_put_cors_method_returns_error(
        boto_conn):
    '''
    tests False bucket not updated.
    '''
    boto_conn.put_bucket_cors.side_effect = exceptions.ClientError(
        error_content, 'put_bucket_cors')
    result = boto_s3_bucket.put_cors(Bucket='mybucket',
                                     CORSRules='[]',
                                     **pytest.conn_parameters)
    assert result.get(
        'error', {}).get('message') == error_message.format('put_bucket_cors')
 def test_that_when_putting_cors_fails_the_put_cors_method_returns_error(
         self):
     """
     tests False bucket not updated.
     """
     self.conn.put_bucket_cors.side_effect = ClientError(
         error_content, "put_bucket_cors")
     result = boto_s3_bucket.put_cors(Bucket="mybucket",
                                      CORSRules="[]",
                                      **conn_parameters)
     assert result.get(
         "error",
         {}).get("message") == error_message.format("put_bucket_cors")