<commit_before># -*- coding: utf-8 -*-
"""Storj API bucket endpoint integration tests."""

import pytest


from . import Integration


class Bucket(Integration):
    """Test case for the bucket endpoint.

    Attributes:
        bucket (:py:class:`storj.models.Bucket`: test bucket.
    """

    def setUp(self):
        """Setup test bucket."""
        super(Bucket, self).setUp()
        self.bucket = self.client.bucket_create('integration-%s' % self.test_id)

    def tearDown(self):
        """Destroy test bucket."""
        super(Bucket, self).tearDown()
        self.client.bucket_delete(self.bucket.id)

    def test(self):
        """Test:

        1. after setup
        1.1 get retrieves the bucket
        1.2 list has bucket

        2. delete bucket
        1.1 get does not retrieve the bucket
        1.2 list does not have bucket
        """
        self.logger.debug('---------- %s.test() ----------' % __name__)

        self.logger.debug('%s 1.1' % __name__)
        assert self.bucket == self.client.bucket_get(self.bucket.id)

        self.logger.debug('%s 1.2' % __name__)
        assert self.bucket in self.client.bucket_list()

        self.logger.debug('%s 2.' % __name__)
        self.client.bucket_delete(self.bucket.id)

        self.logger.debug('%s 2.1' % __name__)
        assert self.client.bucket_get(self.bucket.id) is None<commit_msg>bump version, update contributors, fix typo in tests<commit_after># -*- coding: utf-8 -*-
"""Storj API bucket endpoint integration tests."""

import pytest


from . import Integration


class Bucket(Integration):
    """Test case for the bucket endpoint.

    Attributes:
        bucket (:py:class:`storj.models.Bucket`: test bucket.
    """

    def setUp(self):
        """Setup test bucket."""
        super(Bucket, self).setUp()
        self.bucket = self.client.bucket_create('integration-%s' % self.test_id)

    def tearDown(self):
        """Destroy test bucket."""
        super(Bucket, self).tearDown()
        self.client.bucket_delete(self.bucket.id)

    def test(self):
        """Test:

        1. after setup
        1.1 get retrieves the bucket
        1.2 list has bucket

        2. delete bucket
        2.1 get does not retrieve the bucket
        2.2 list does not have bucket
        """
        self.logger.debug('---------- %s.test() ----------' % __name__)

        self.logger.debug('%s 1.1' % __name__)
        assert self.bucket == self.client.bucket_get(self.bucket.id)

        self.logger.debug('%s 1.2' % __name__)
        assert self.bucket in self.client.bucket_list()

        self.logger.debug('%s 2.' % __name__)
        self.client.bucket_delete(self.bucket.id)

        self.logger.debug('%s 2.1' % __name__)
        assert self.client.bucket_get(self.bucket.id) is None
{'fraction_non_alphanumeric': 0.14455231930960086, 'fraction_numerical': 0.012944983818770227, 'mean_word_length': 2.2199074074074074, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4717729', 'n_tokens_mistral': 862, 'n_tokens_neox': 821, 'n_words': 212}