# Path: barbicanclient/tests/test_client.py
# class TestClient(testtools.TestCase):
# class WhenTestingClientInit(TestClient):
# class WhenTestingClientPost(TestClient):
# class WhenTestingClientPut(TestClient):
# class WhenTestingClientGet(TestClient):
# class WhenTestingClientDelete(TestClient):
# class WhenTestingCheckStatusCodes(TestClient):
# class WhenTestingGetErrorMessage(TestClient):
# class BaseEntityResource(testtools.TestCase):
#     def setUp(self):
#     def test_api_version_is_appended_to_endpoint(self):
#     def test_default_headers_are_empty(self):
#     def test_project_id_is_added_to_default_headers(self):
#     def test_error_thrown_when_no_session_and_no_endpoint(self):
#     def test_error_thrown_when_no_session_and_no_project_id(self):
#     def test_endpoint_override_starts_with_endpoint_url(self):
#     def test_endpoint_override_ends_with_default_api_version(self):
#     def setUp(self):
#     def test_post_normalizes_url_with_traling_slash(self):
#     def test_post_includes_content_type_header_of_application_json(self):
#     def test_post_includes_default_headers(self):
#     def test_post_checks_status_code(self):
#     def setUp(self):
#     def test_put_uses_href_as_is(self):
#     def test_put_passes_data(self):
#     def test_put_includes_default_headers(self):
#     def test_put_checks_status_code(self):
#     def setUp(self):
#     def test_get_uses_href_as_is(self):
#     def test_get_passes_params(self):
#     def test_get_includes_accept_header_of_application_json(self):
#     def test_get_includes_default_headers(self):
#     def test_get_checks_status_code(self):
#     def test_get_raw_uses_href_as_is(self):
#     def test_get_raw_passes_headers(self):
#     def test_get_raw_includes_default_headers(self):
#     def test_get_raw_checks_status_code(self):
#     def setUp(self):
#     def test_delete_uses_href_as_is(self):
#     def test_delete_passes_json(self):
#     def test_delete_includes_default_headers(self):
#     def test_delete_checks_status_code(self):
#     def test_raises_http_auth_error_for_401_response(self):
#     def test_raises_http_server_error_for_500_response(self):
#     def test_raises_http_client_error_for_400_response(self):
#     def test_gets_error_message_from_title_in_json(self):
#     def test_gets_error_message_from_content_when_no_json(self):
#     def test_gets_error_message_from_description_in_json(self):
#     def _setUp(self, entity, entity_id='abcd1234-eabc-5678-9abc-abcdef012345'):
# 
# Path: barbicanclient/v1/cas.py
# LOG = logging.getLogger(__name__)
# def lazy(func):
#     def wrapper(self, *args):
#     def _get_formatted_data(self):
#     def __init__(self, api, meta=None, expiration=None,
#                  plugin_name=None, plugin_ca_id=None,
#                  ca_ref=None, created=None, updated=None,
#                  status=None, creator_id=None):
#     def ca_ref(self):
#     def name(self):
#     def expiration(self):
#     def description(self):
#     def plugin_name(self):
#     def plugin_ca_id(self):
#     def created(self):
#     def updated(self):
#     def status(self):
#     def _fill_from_data(self, meta=None, expiration=None,
#                         plugin_name=None, plugin_ca_id=None, created=None,
#                         updated=None, status=None, creator_id=None):
#     def _fill_lazy_properties(self):
#     def __repr__(self):
#     def __init__(self, api):
#     def get(self, ca_ref):
#     def list(self, limit=10, offset=0, name=None):
# class CAFormatter(formatter.EntityFormatter):
# class CA(CAFormatter):
# class CAManager(base.BaseEntityManager):


from oslo_utils import timeutils
from barbicanclient.tests import test_client
from barbicanclient.v1 import cas
    def test_should_get_list(self):
        ca_resp = self.entity_href

        data = {"cas": [ca_resp for v in range(3)]}
        m = self.responses.get(self.entity_base, json=data)

        ca_list = self.manager.list(limit=10, offset=5)
        self.assertTrue(len(ca_list) == 3)
        self.assertIsInstance(ca_list[0], cas.CA)
        self.assertEqual(self.entity_href, ca_list[0].ca_ref)

        # Verify the correct URL was used to make the call.
        self.assertEqual(self.entity_base,
                         m.last_request.url.split('?')[0])

        # Verify that correct information was sent in the call.
        self.assertEqual(['10'], m.last_request.qs['limit'])
        self.assertEqual(['5'], m.last_request.qs['offset'])

    def test_should_fail_get_invalid_ca(self):
        self.assertRaises(ValueError, self.manager.get,
                          **{'ca_ref': '12345'})

    def test_should_get_ca_that_has_no_meta_description(self):
        self.ca = CAData(description=None)

        data = self.ca.get_dict(self.entity_href)
        m = self.responses.get(self.entity_href, json=data)

        ca = self.manager.get(ca_ref=self.entity_href)

# Path: barbicanclient/tests/test_client.py
# class TestClient(testtools.TestCase):
# class WhenTestingClientInit(TestClient):
# class WhenTestingClientPost(TestClient):
# class WhenTestingClientPut(TestClient):
# class WhenTestingClientGet(TestClient):
# class WhenTestingClientDelete(TestClient):
# class WhenTestingCheckStatusCodes(TestClient):
# class WhenTestingGetErrorMessage(TestClient):
# class BaseEntityResource(testtools.TestCase):
#     def setUp(self):
#     def test_api_version_is_appended_to_endpoint(self):
#     def test_default_headers_are_empty(self):
#     def test_project_id_is_added_to_default_headers(self):
#     def test_error_thrown_when_no_session_and_no_endpoint(self):
#     def test_error_thrown_when_no_session_and_no_project_id(self):
#     def test_endpoint_override_starts_with_endpoint_url(self):
#     def test_endpoint_override_ends_with_default_api_version(self):
#     def setUp(self):
#     def test_post_normalizes_url_with_traling_slash(self):
#     def test_post_includes_content_type_header_of_application_json(self):
#     def test_post_includes_default_headers(self):
#     def test_post_checks_status_code(self):
#     def setUp(self):
#     def test_put_uses_href_as_is(self):
#     def test_put_passes_data(self):
#     def test_put_includes_default_headers(self):
#     def test_put_checks_status_code(self):
#     def setUp(self):
#     def test_get_uses_href_as_is(self):
#     def test_get_passes_params(self):
#     def test_get_includes_accept_header_of_application_json(self):
#     def test_get_includes_default_headers(self):
#     def test_get_checks_status_code(self):
#     def test_get_raw_uses_href_as_is(self):
#     def test_get_raw_passes_headers(self):
#     def test_get_raw_includes_default_headers(self):
#     def test_get_raw_checks_status_code(self):
#     def setUp(self):
#     def test_delete_uses_href_as_is(self):
#     def test_delete_passes_json(self):
#     def test_delete_includes_default_headers(self):
#     def test_delete_checks_status_code(self):
#     def test_raises_http_auth_error_for_401_response(self):
#     def test_raises_http_server_error_for_500_response(self):
#     def test_raises_http_client_error_for_400_response(self):
#     def test_gets_error_message_from_title_in_json(self):
#     def test_gets_error_message_from_content_when_no_json(self):
#     def test_gets_error_message_from_description_in_json(self):
#     def _setUp(self, entity, entity_id='abcd1234-eabc-5678-9abc-abcdef012345'):
# 
# Path: barbicanclient/v1/cas.py
# LOG = logging.getLogger(__name__)
# def lazy(func):
#     def wrapper(self, *args):
#     def _get_formatted_data(self):
#     def __init__(self, api, meta=None, expiration=None,
#                  plugin_name=None, plugin_ca_id=None,
#                  ca_ref=None, created=None, updated=None,
#                  status=None, creator_id=None):
#     def ca_ref(self):
#     def name(self):
#     def expiration(self):
#     def description(self):
#     def plugin_name(self):
#     def plugin_ca_id(self):
#     def created(self):
#     def updated(self):
#     def status(self):
#     def _fill_from_data(self, meta=None, expiration=None,
#                         plugin_name=None, plugin_ca_id=None, created=None,
#                         updated=None, status=None, creator_id=None):
#     def _fill_lazy_properties(self):
#     def __repr__(self):
#     def __init__(self, api):
#     def get(self, ca_ref):
#     def list(self, limit=10, offset=0, name=None):
# class CAFormatter(formatter.EntityFormatter):
# class CA(CAFormatter):
# class CAManager(base.BaseEntityManager):


# Path: barbicanclient/tests/v1/test_cas.py
from oslo_utils import timeutils
from barbicanclient.tests import test_client
from barbicanclient.v1 import cas

    def test_should_get_list(self):
        ca_resp = self.entity_href

        data = {"cas": [ca_resp for v in range(3)]}
        m = self.responses.get(self.entity_base, json=data)

        ca_list = self.manager.list(limit=10, offset=5)
        self.assertTrue(len(ca_list) == 3)
        self.assertIsInstance(ca_list[0], cas.CA)
        self.assertEqual(self.entity_href, ca_list[0].ca_ref)

        # Verify the correct URL was used to make the call.
        self.assertEqual(self.entity_base,
                         m.last_request.url.split('?')[0])

        # Verify that correct information was sent in the call.
        self.assertEqual(['10'], m.last_request.qs['limit'])
        self.assertEqual(['5'], m.last_request.qs['offset'])

    def test_should_fail_get_invalid_ca(self):
        self.assertRaises(ValueError, self.manager.get,
                          **{'ca_ref': '12345'})

    def test_should_get_ca_that_has_no_meta_description(self):
        self.ca = CAData(description=None)

        data = self.ca.get_dict(self.entity_href)
        m = self.responses.get(self.entity_href, json=data)

        ca = self.manager.get(ca_ref=self.entity_href)

        self.assertIsInstance(ca, cas.CA)