# 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/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/common/keys.py
# def get_private_key_pem():
# def get_private_key_der():
# def get_public_key_pem():
# def get_public_key_der():
# def get_encrypted_private_key_pem():
# def get_passphrase_txt():
# def get_csr_pem():
# def get_certificate_pem():
# def get_certificate_der():
# 
# 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):


import base64
import datetime
import sys
import time
from barbicanclient import exceptions
from functionaltests.client import base
from functionaltests.common import cleanup
from functionaltests.common import keys
from functionaltests import utils
from testtools import testcase
        secret = self.barbicanclient.secrets.create(
            **secret_create_defaults_data)
        secret.algorithm = algorithm

        # We are currently testing for exception with http_code
        # launchpad bug 1431514 will address the change to this functionality
        e = self.assertRaises(
            exceptions.HTTPClientError,
            secret.store
        )

        self.assertEqual(400, e.status_code)

    @utils.parameterized_dataset({
        'symmetric': ['symmetric',
                      'aes',
                      128,
                      (b'\x00\x01\x02\x03\x04\x05\x06\x07'
                       b'\x00\x01\x02\x03\x04\x05\x06\x07')],
        'private': ['private',
                    'rsa',
                    2048,
                    keys.get_private_key_pem()],
        'public': ['public',
                   'rsa',
                   2048,
                   keys.get_public_key_pem()],
        'certificate': ['certificate',
                        'rsa',
                        2048,

# 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/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/common/keys.py
# def get_private_key_pem():
# def get_private_key_der():
# def get_public_key_pem():
# def get_public_key_der():
# def get_encrypted_private_key_pem():
# def get_passphrase_txt():
# def get_csr_pem():
# def get_certificate_pem():
# def get_certificate_der():
# 
# 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: functionaltests/client/v1/functional/test_secrets.py
import base64
import datetime
import sys
import time
from barbicanclient import exceptions
from functionaltests.client import base
from functionaltests.common import cleanup
from functionaltests.common import keys
from functionaltests import utils
from testtools import testcase

        secret = self.barbicanclient.secrets.create(
            **secret_create_defaults_data)
        secret.algorithm = algorithm

        # We are currently testing for exception with http_code
        # launchpad bug 1431514 will address the change to this functionality
        e = self.assertRaises(
            exceptions.HTTPClientError,
            secret.store
        )

        self.assertEqual(400, e.status_code)

    @utils.parameterized_dataset({
        'symmetric': ['symmetric',
                      'aes',
                      128,
                      (b'\x00\x01\x02\x03\x04\x05\x06\x07'
                       b'\x00\x01\x02\x03\x04\x05\x06\x07')],
        'private': ['private',
                    'rsa',
                    2048,
                    keys.get_private_key_pem()],
        'public': ['public',
                   'rsa',
                   2048,
                   keys.get_public_key_pem()],
        'certificate': ['certificate',
                        'rsa',
                        2048,

                        keys.get_certificate_pem()],