# Path: functionaltests/client/base.py
# CONF = config.get_config()
# class TestCase(BaseTestCase):
#     def setUp(self):
# 
# Path: functionaltests/common/cleanup.py
# class CleanUp(object):
#     def __init__(self, barbicanclient):
#     def delete_all_entities(self):
#     def add_entity(self, entity):
#     def _delete_all_containers(self):
#     def _delete_all_secrets(self):
#     def _delete_all_acls(self):
#     def _delete_all_orders(self):
# 
# Path: functionaltests/utils.py
# class BaseTestCase(oslotest.BaseTestCase):
#     def setUp(self):
#     def tearDown(self):
# def construct_new_test_function(original_func, name, build_params):
#     def test_wrapper(func, test_args, test_kwargs):
#         def wrapper(self):
# def process_parameterized_function(name, func_obj, build_data):
# def parameterized_test_case(cls):
# def parameterized_dataset(build_data):
#     def decorator(func):
# def create_timestamp_w_tz_and_offset(timezone=None, days=0, hours=0, minutes=0,
#                                      seconds=0):
# def get_limit_and_offset_from_ref(ref):
# def get_tomorrow_timestamp():
# def string_to_datetime(datetimestring, date_formats=None):
# def get_id_from_ref(ref):
# 
# Path: barbicanclient/exceptions.py
# class BarbicanException(Exception):
# class PayloadException(BarbicanException):
# class UnsupportedVersion(BarbicanException):
# class HTTPError(Exception):
# class HTTPServerError(HTTPError):
# class HTTPClientError(HTTPError):
# class HTTPAuthError(HTTPError):
#     def __init__(self, message, status_code=0):
#     def __init__(self, message, status_code=401):


from functionaltests.client import base
from functionaltests.common import cleanup
from functionaltests import utils
from testtools import testcase
from barbicanclient import exceptions
    def test_delete_non_existent_container_valid_uuid(self):
        """A delete on a container that does not exist with valid UUID

        This should return a 404.
        """
        uuid = 'de305d54-75b4-431b-cccc-eb6b9e546013'
        base_url = self.barbicanclient.containers._api.endpoint_override
        url = base_url + '/containers/' + uuid

        e = self.assertRaises(
            exceptions.HTTPClientError,
            self.barbicanclient.containers.get,
            url
        )

        self.assertEqual(404, e.status_code)

    @utils.parameterized_dataset({'0': [0], '1': [1], '50': [50]})
    @testcase.attr('positive')
    def test_create_container_defaults_size(self, num_secrets):
        """Covers creating containers of various sizes."""
        secrets = {}
        for i in range(0, num_secrets):
            secret_ref, secret = self._create_a_secret()
            secrets['other_secret{0}'.format(i)] = secret

        create_container_defaults_data['secrets'] = secrets
        container = self.barbicanclient.containers.create(
            **create_container_defaults_data)


# Path: functionaltests/client/base.py
# CONF = config.get_config()
# class TestCase(BaseTestCase):
#     def setUp(self):
# 
# Path: functionaltests/common/cleanup.py
# class CleanUp(object):
#     def __init__(self, barbicanclient):
#     def delete_all_entities(self):
#     def add_entity(self, entity):
#     def _delete_all_containers(self):
#     def _delete_all_secrets(self):
#     def _delete_all_acls(self):
#     def _delete_all_orders(self):
# 
# Path: functionaltests/utils.py
# class BaseTestCase(oslotest.BaseTestCase):
#     def setUp(self):
#     def tearDown(self):
# def construct_new_test_function(original_func, name, build_params):
#     def test_wrapper(func, test_args, test_kwargs):
#         def wrapper(self):
# def process_parameterized_function(name, func_obj, build_data):
# def parameterized_test_case(cls):
# def parameterized_dataset(build_data):
#     def decorator(func):
# def create_timestamp_w_tz_and_offset(timezone=None, days=0, hours=0, minutes=0,
#                                      seconds=0):
# def get_limit_and_offset_from_ref(ref):
# def get_tomorrow_timestamp():
# def string_to_datetime(datetimestring, date_formats=None):
# def get_id_from_ref(ref):
# 
# Path: barbicanclient/exceptions.py
# class BarbicanException(Exception):
# class PayloadException(BarbicanException):
# class UnsupportedVersion(BarbicanException):
# class HTTPError(Exception):
# class HTTPServerError(HTTPError):
# class HTTPClientError(HTTPError):
# class HTTPAuthError(HTTPError):
#     def __init__(self, message, status_code=0):
#     def __init__(self, message, status_code=401):


# Path: functionaltests/client/v1/functional/test_containers.py
from functionaltests.client import base
from functionaltests.common import cleanup
from functionaltests import utils
from testtools import testcase
from barbicanclient import exceptions

    def test_delete_non_existent_container_valid_uuid(self):
        """A delete on a container that does not exist with valid UUID

        This should return a 404.
        """
        uuid = 'de305d54-75b4-431b-cccc-eb6b9e546013'
        base_url = self.barbicanclient.containers._api.endpoint_override
        url = base_url + '/containers/' + uuid

        e = self.assertRaises(
            exceptions.HTTPClientError,
            self.barbicanclient.containers.get,
            url
        )

        self.assertEqual(404, e.status_code)

    @utils.parameterized_dataset({'0': [0], '1': [1], '50': [50]})
    @testcase.attr('positive')
    def test_create_container_defaults_size(self, num_secrets):
        """Covers creating containers of various sizes."""
        secrets = {}
        for i in range(0, num_secrets):
            secret_ref, secret = self._create_a_secret()
            secrets['other_secret{0}'.format(i)] = secret

        create_container_defaults_data['secrets'] = secrets
        container = self.barbicanclient.containers.create(
            **create_container_defaults_data)


        container_ref = self.cleanup.add_entity(container)