예제 #1
0
 def test_that_when_describing_bucket_on_client_error_it_returns_error(self):
     '''
     Tests describing parameters failure
     '''
     self.conn.get_bucket_acl.side_effect = ClientError(error_content, 'get_bucket_acl')
     result = boto_s3_bucket.describe(Bucket='mybucket', **conn_parameters)
     self.assertTrue('error' in result)
예제 #2
0
 def test_that_when_describing_bucket_on_client_error_it_returns_error(self):
     '''
     Tests describing parameters failure
     '''
     self.conn.get_bucket_acl.side_effect = ClientError(error_content, 'get_bucket_acl')
     result = boto_s3_bucket.describe(Bucket='mybucket', **conn_parameters)
     self.assertTrue('error' in result)
예제 #3
0
    def test_that_when_describing_bucket_it_returns_the_dict_of_properties_returns_false(self):
        '''
        Tests describing parameters if bucket does not exist
        '''
        self.conn.get_bucket_acl.side_effect = not_found_error
        result = boto_s3_bucket.describe(Bucket='mybucket', **conn_parameters)

        self.assertFalse(result['bucket'])
예제 #4
0
    def test_that_when_describing_bucket_it_returns_the_dict_of_properties_returns_false(self):
        '''
        Tests describing parameters if bucket does not exist
        '''
        self.conn.get_bucket_acl.side_effect = not_found_error
        result = boto_s3_bucket.describe(Bucket='mybucket', **conn_parameters)

        self.assertFalse(result['bucket'])
예제 #5
0
 def test_that_when_describing_bucket_on_client_error_it_returns_error(
         self):
     """
     Tests describing parameters failure
     """
     self.conn.get_bucket_acl.side_effect = ClientError(
         error_content, "get_bucket_acl")
     result = boto_s3_bucket.describe(Bucket="mybucket", **conn_parameters)
     self.assertTrue("error" in result)
    def test_that_when_describing_bucket_it_returns_the_dict_of_properties_returns_false(
        self, ):
        """
        Tests describing parameters if bucket does not exist
        """
        self.conn.get_bucket_acl.side_effect = not_found_error
        result = boto_s3_bucket.describe(Bucket="mybucket", **conn_parameters)

        assert not result["bucket"]
예제 #7
0
    def test_that_when_describing_bucket_it_returns_the_dict_of_properties_returns_true(self):
        '''
        Tests describing parameters if bucket exists
        '''
        for key, value in six.iteritems(config_ret):
            getattr(self.conn, key).return_value = deepcopy(value)

        result = boto_s3_bucket.describe(Bucket='mybucket', **conn_parameters)

        self.assertTrue(result['bucket'])
예제 #8
0
    def test_that_when_describing_bucket_it_returns_the_dict_of_properties_returns_true(self):
        '''
        Tests describing parameters if bucket exists
        '''
        for key, value in config_ret.iteritems():
            getattr(self.conn, key).return_value = deepcopy(value)

        result = boto_s3_bucket.describe(Bucket='mybucket', **conn_parameters)

        self.assertTrue(result['bucket'])
예제 #9
0
def test_that_when_describing_bucket_on_client_error_it_returns_error(
        boto_conn):
    '''
    Tests describing parameters failure
    '''
    boto_conn.get_bucket_acl.side_effect = exceptions.ClientError(
        error_content, 'get_bucket_acl')
    result = boto_s3_bucket.describe(Bucket='mybucket',
                                     **pytest.conn_parameters)
    assert 'error' in result
예제 #10
0
    def test_that_when_describing_bucket_it_returns_the_dict_of_properties_returns_true(
        self, ):
        """
        Tests describing parameters if bucket exists
        """
        for key, value in six.iteritems(config_ret):
            getattr(self.conn, key).return_value = deepcopy(value)

        result = boto_s3_bucket.describe(Bucket="mybucket", **conn_parameters)

        self.assertTrue(result["bucket"])
예제 #11
0
def test_that_when_describing_bucket_it_returns_the_dict_of_properties_returns_true(
        boto_conn):
    '''
    Tests describing parameters if bucket exists
    '''
    for key, value in six.iteritems(config_ret):
        getattr(boto_conn.conn, key).return_value = deepcopy(value)

    result = boto_s3_bucket.describe(Bucket='mybucket',
                                     **pytest.conn_parameters)

    assert result['bucket']