# Path: deckhand/factories.py
# LOG = logging.getLogger(__name__)
# DOCUMENT_TEST_SCHEMA = 'example/Kind/v1'
#     DATA_SCHEMA_TEMPLATE = {
#         "data": {
#             "$schema": ""
#         },
#         "metadata": {
#             "schema": "metadata/Control/v1",
#             "name": "",
#             "labels": {},
#             "layeringDefinition": {
#                 "abstract": True,
#                 "layer": "site"
#             }
#         },
#         "schema": "deckhand/DataSchema/v1"
#     }
#     LAYERING_POLICY_TEMPLATE = {
#         "data": {
#             "layerOrder": []
#         },
#         "metadata": {
#             "name": "placeholder",
#             "schema": "metadata/Control/v1",
#             "layeringDefinition": {
#                 "abstract": False,
#                 "layer": "layer"
#             }
#         },
#         "schema": "deckhand/LayeringPolicy/v1"
#     }
#     DOCUMENT_TEMPLATE = {
#         "data": {},
#         "metadata": {
#             "labels": {"": ""},
#             "layeringDefinition": {
#                 "abstract": False,
#                 "layer": "layer"
#             },
#             "name": "",
#             "schema": "metadata/Document/v1"
#         },
#         "schema": DOCUMENT_TEST_SCHEMA
#     }
#     DOCUMENT_SECRET_TEMPLATE = {
#         "data": {
#         },
#         "metadata": {
#             "schema": "metadata/Document/v1",
#             "name": "",
#             "layeringDefinition": {
#                 "abstract": False,
#                 "layer": "site"
#             },
#             "storagePolicy": "",
#         },
#         "schema": "deckhand/%s/v1"
#     }
# class DeckhandFactory(object):
# class DataSchemaFactory(DeckhandFactory):
# class DocumentFactory(DeckhandFactory):
# class DocumentSecretFactory(DeckhandFactory):
#     def gen_test(self, *args, **kwargs):
#     def __init__(self):
#     def gen_test(self, metadata_name, data, **metadata_labels):
#     def __init__(self, num_layers, docs_per_layer):
#     def gen_test(self, mapping, site_abstract=True, region_abstract=True,
#                  global_abstract=True, site_parent_selectors=None):
#     def __init__(self):
#     def gen_test(self, schema, storage_policy, data=None, name=None):
# 
# Path: deckhand/tests/test_utils.py
# def rand_uuid_hex():
# def rand_name(name='', prefix='deckhand'):
# def rand_bool():
# def rand_int(min, max):
# def rand_password(length=15):
# 
# Path: deckhand/tests/unit/db/base.py
# BASE_EXPECTED_FIELDS = ("created_at", "updated_at", "deleted_at", "deleted")
# DOCUMENT_EXPECTED_FIELDS = BASE_EXPECTED_FIELDS + (
#     "id", "schema", "name", "layer", "metadata", "data", "data_hash",
#     "metadata_hash", "revision_id", "bucket_id")
# REVISION_EXPECTED_FIELDS = ("id", "documents", "tags")
# class DocumentFixture(object):
# class TestDbBase(base.DeckhandWithDBTestCase):
#     def get_minimal_fixture(**kwargs):
#     def get_minimal_multi_fixture(count=2, **kwargs):
#     def create_documents(self, bucket_name, documents,
#                          validation_policies=None):
#     def show_document(self, **fields):
#     def create_revision(self):
#     def show_revision(self, revision_id):
#     def delete_revisions(self):
#     def list_revision_documents(self, revision_id, **filters):
#     def list_revisions(self):
#     def rollback_revision(self, revision_id):
#     def create_validation(self, revision_id, val_name, val_data):
#     def _validate_object(self, obj):
#     def validate_document(self, actual, expected=None, is_deleted=False):
#     def validate_revision(self, revision):


from deckhand import factories
from deckhand.tests import test_utils
from deckhand.tests.unit.db import base
# Copyright 2017 AT&T Intellectual Property.  All other rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.



class TestDocuments(base.TestDbBase):

    def setUp(self):
        super(TestDocuments, self).setUp()
        # Will create 3 documents: layering policy, plus a global and site
        # document.
        self.secrets_factory = factories.DocumentSecretFactory()

# Path: deckhand/factories.py
# LOG = logging.getLogger(__name__)
# DOCUMENT_TEST_SCHEMA = 'example/Kind/v1'
#     DATA_SCHEMA_TEMPLATE = {
#         "data": {
#             "$schema": ""
#         },
#         "metadata": {
#             "schema": "metadata/Control/v1",
#             "name": "",
#             "labels": {},
#             "layeringDefinition": {
#                 "abstract": True,
#                 "layer": "site"
#             }
#         },
#         "schema": "deckhand/DataSchema/v1"
#     }
#     LAYERING_POLICY_TEMPLATE = {
#         "data": {
#             "layerOrder": []
#         },
#         "metadata": {
#             "name": "placeholder",
#             "schema": "metadata/Control/v1",
#             "layeringDefinition": {
#                 "abstract": False,
#                 "layer": "layer"
#             }
#         },
#         "schema": "deckhand/LayeringPolicy/v1"
#     }
#     DOCUMENT_TEMPLATE = {
#         "data": {},
#         "metadata": {
#             "labels": {"": ""},
#             "layeringDefinition": {
#                 "abstract": False,
#                 "layer": "layer"
#             },
#             "name": "",
#             "schema": "metadata/Document/v1"
#         },
#         "schema": DOCUMENT_TEST_SCHEMA
#     }
#     DOCUMENT_SECRET_TEMPLATE = {
#         "data": {
#         },
#         "metadata": {
#             "schema": "metadata/Document/v1",
#             "name": "",
#             "layeringDefinition": {
#                 "abstract": False,
#                 "layer": "site"
#             },
#             "storagePolicy": "",
#         },
#         "schema": "deckhand/%s/v1"
#     }
# class DeckhandFactory(object):
# class DataSchemaFactory(DeckhandFactory):
# class DocumentFactory(DeckhandFactory):
# class DocumentSecretFactory(DeckhandFactory):
#     def gen_test(self, *args, **kwargs):
#     def __init__(self):
#     def gen_test(self, metadata_name, data, **metadata_labels):
#     def __init__(self, num_layers, docs_per_layer):
#     def gen_test(self, mapping, site_abstract=True, region_abstract=True,
#                  global_abstract=True, site_parent_selectors=None):
#     def __init__(self):
#     def gen_test(self, schema, storage_policy, data=None, name=None):
# 
# Path: deckhand/tests/test_utils.py
# def rand_uuid_hex():
# def rand_name(name='', prefix='deckhand'):
# def rand_bool():
# def rand_int(min, max):
# def rand_password(length=15):
# 
# Path: deckhand/tests/unit/db/base.py
# BASE_EXPECTED_FIELDS = ("created_at", "updated_at", "deleted_at", "deleted")
# DOCUMENT_EXPECTED_FIELDS = BASE_EXPECTED_FIELDS + (
#     "id", "schema", "name", "layer", "metadata", "data", "data_hash",
#     "metadata_hash", "revision_id", "bucket_id")
# REVISION_EXPECTED_FIELDS = ("id", "documents", "tags")
# class DocumentFixture(object):
# class TestDbBase(base.DeckhandWithDBTestCase):
#     def get_minimal_fixture(**kwargs):
#     def get_minimal_multi_fixture(count=2, **kwargs):
#     def create_documents(self, bucket_name, documents,
#                          validation_policies=None):
#     def show_document(self, **fields):
#     def create_revision(self):
#     def show_revision(self, revision_id):
#     def delete_revisions(self):
#     def list_revision_documents(self, revision_id, **filters):
#     def list_revisions(self):
#     def rollback_revision(self, revision_id):
#     def create_validation(self, revision_id, val_name, val_data):
#     def _validate_object(self, obj):
#     def validate_document(self, actual, expected=None, is_deleted=False):
#     def validate_revision(self, revision):


# Path: deckhand/tests/unit/db/test_documents.py
from deckhand import factories
from deckhand.tests import test_utils
from deckhand.tests.unit.db import base

# Copyright 2017 AT&T Intellectual Property.  All other rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.



class TestDocuments(base.TestDbBase):

    def setUp(self):
        super(TestDocuments, self).setUp()
        # Will create 3 documents: layering policy, plus a global and site
        # document.
        self.secrets_factory = factories.DocumentSecretFactory()

        self.documents_factory = factories.DocumentFactory(2, [1, 1])