def test_that_when_listing_bucket_fails_the_list_bucket_method_returns_error(self): ''' tests False bucket error. ''' self.conn.list_buckets.side_effect = ClientError(error_content, 'list_buckets') result = boto_s3_bucket.list(**conn_parameters) self.assertEqual(result.get('error', {}).get('message'), error_message.format('list_buckets'))
def test_that_when_listing_buckets_succeeds_the_list_buckets_method_returns_true(self): ''' tests True buckets listed. ''' self.conn.list_buckets.return_value = deepcopy(list_ret) result = boto_s3_bucket.list(**conn_parameters) self.assertTrue(result['Buckets'])
def test_that_when_listing_buckets_succeeds_the_list_buckets_method_returns_true( boto_conn): ''' tests True buckets listed. ''' boto_conn.list_buckets.return_value = deepcopy(list_ret) result = boto_s3_bucket.list(**pytest.conn_parameters) assert result['Buckets']
def test_that_when_listing_buckets_succeeds_the_list_buckets_method_returns_true( self, ): """ tests True buckets listed. """ self.conn.list_buckets.return_value = deepcopy(list_ret) result = boto_s3_bucket.list(**conn_parameters) assert result["Buckets"]
def test_that_when_listing_bucket_fails_the_list_bucket_method_returns_false(self): ''' tests False no bucket listed. ''' ret = deepcopy(list_ret) log.info(ret) ret['Buckets'] = list() self.conn.list_buckets.return_value = ret result = boto_s3_bucket.list(**conn_parameters) self.assertFalse(result['Buckets'])
def test_that_when_listing_bucket_fails_the_list_bucket_method_returns_error( boto_conn): ''' tests False bucket error. ''' boto_conn.list_buckets.side_effect = exceptions.ClientError( error_content, 'list_buckets') result = boto_s3_bucket.list(**pytest.conn_parameters) assert result.get( 'error', {}).get('message') == error_message.format('list_buckets')
def test_that_when_listing_bucket_fails_the_list_bucket_method_returns_error( self): """ tests False bucket error. """ self.conn.list_buckets.side_effect = ClientError( error_content, "list_buckets") result = boto_s3_bucket.list(**conn_parameters) assert result.get( "error", {}).get("message") == error_message.format("list_buckets")