# 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):


from testtools import testcase
from functionaltests.client import base
from functionaltests.common import cleanup
from functionaltests import utils
# Given that fact, order_create_nones_data is effectively an empty json request
# to the server.
order_create_nones_data = {
    'type': None,
    "meta": {
        "name": None,
        "algorithm": None,
        "bit_length": None,
        "mode": None,
        "payload_content_type": None,
    }
}


@utils.parameterized_test_case
class OrdersTestCase(base.TestCase):

    def setUp(self):
        super(OrdersTestCase, self).setUp()
        self.cleanup = cleanup.CleanUp(self.barbicanclient)

    def tearDown(self):
        self.cleanup.delete_all_entities()
        super(OrdersTestCase, self).tearDown()

    @testcase.attr('positive')
    def test_create_order_defaults(self):
        """Covers simple order creation."""
        order = self.barbicanclient.orders.create_key(
            **order_create_key_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: functionaltests/client/v1/smoke/test_orders.py
from testtools import testcase
from functionaltests.client import base
from functionaltests.common import cleanup
from functionaltests import utils

# Given that fact, order_create_nones_data is effectively an empty json request
# to the server.
order_create_nones_data = {
    'type': None,
    "meta": {
        "name": None,
        "algorithm": None,
        "bit_length": None,
        "mode": None,
        "payload_content_type": None,
    }
}


@utils.parameterized_test_case
class OrdersTestCase(base.TestCase):

    def setUp(self):
        super(OrdersTestCase, self).setUp()
        self.cleanup = cleanup.CleanUp(self.barbicanclient)

    def tearDown(self):
        self.cleanup.delete_all_entities()
        super(OrdersTestCase, self).tearDown()

    @testcase.attr('positive')
    def test_create_order_defaults(self):
        """Covers simple order creation."""
        order = self.barbicanclient.orders.create_key(
            **order_create_key_data)

        order_ref = self.cleanup.add_entity(order)