# Path: testbench/rest_server.py
# def index():
# def raise_error():
# def xml_put_object(bucket_name, object_name):
# def xml_get_object(bucket_name, object_name):
# def root_get_object(bucket_name, object_name):
# def root_get_object_with_bucket(bucket_name, object_name):
# def root_put_object(bucket_name, object_name):
# def root_create_resumable_object(bucket_name, object_name):
# def root_put_object_with_bucket(bucket_name, object_name):
# def list_retry_tests():
# def create_retry_test():
# def get_retry_test(test_id):
# def delete_retry_test(test_id):
# def start_grpc():
# def bucket_list():
# def bucket_insert():
# def bucket_get(bucket_name):
# def bucket_update(bucket_name):
# def bucket_patch(bucket_name):
# def bucket_delete(bucket_name):
# def bucket_acl_list(bucket_name):
# def bucket_acl_insert(bucket_name):
# def bucket_acl_get(bucket_name, entity):
# def bucket_acl_update(bucket_name, entity):
# def bucket_acl_patch(bucket_name, entity):
# def bucket_acl_delete(bucket_name, entity):
# def bucket_default_object_acl_list(bucket_name):
# def bucket_default_object_acl_insert(bucket_name):
# def bucket_default_object_acl_get(bucket_name, entity):
# def bucket_default_object_acl_update(bucket_name, entity):
# def bucket_default_object_acl_patch(bucket_name, entity):
# def bucket_default_object_acl_delete(bucket_name, entity):
# def bucket_notification_list(bucket_name):
# def bucket_notification_insert(bucket_name):
# def bucket_notification_get(bucket_name, notification_id):
# def bucket_notification_delete(bucket_name, notification_id):
# def bucket_get_iam_policy(bucket_name):
# def bucket_set_iam_policy(bucket_name):
# def bucket_test_iam_permissions(bucket_name):
# def bucket_lock_retention_policy(bucket_name):
# def object_list(bucket_name):
# def object_update(bucket_name, object_name):
# def object_patch(bucket_name, object_name):
# def object_delete(bucket_name, object_name):
# def object_get(bucket_name, object_name):
# def objects_compose(bucket_name, object_name):
#         def precondition(_, live_version, ctx):
# def objects_copy(src_bucket_name, src_object_name, dst_bucket_name, dst_object_name):
# def objects_rewrite(src_bucket_name, src_object_name, dst_bucket_name, dst_object_name):
# def object_acl_list(bucket_name, object_name):
# def object_acl_insert(bucket_name, object_name):
# def object_acl_get(bucket_name, object_name, entity):
# def object_acl_update(bucket_name, object_name, entity):
# def object_acl_patch(bucket_name, object_name, entity):
# def object_acl_delete(bucket_name, object_name, entity):
# def download_object_get(bucket_name, object_name):
# def object_insert(bucket_name):
# def resumable_upload_chunk(bucket_name):
# def delete_resumable_upload(bucket_name):
# def _run():
# def _main():
# GCS_HANDLER_PATH = "/storage/v1"
# DOWNLOAD_HANDLER_PATH = "/download/storage/v1"
# UPLOAD_HANDLER_PATH = "/upload/storage/v1"


import json
import os
import unittest
from testbench import rest_server
#!/usr/bin/env python3
#
# Copyright 2021 Google LLC
#
# 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.

"""Unit test for bucket operations in the testbench."""




class TestTestbenchBucket(unittest.TestCase):
    def setUp(self):
        rest_server.db.clear()

# Path: testbench/rest_server.py
# def index():
# def raise_error():
# def xml_put_object(bucket_name, object_name):
# def xml_get_object(bucket_name, object_name):
# def root_get_object(bucket_name, object_name):
# def root_get_object_with_bucket(bucket_name, object_name):
# def root_put_object(bucket_name, object_name):
# def root_create_resumable_object(bucket_name, object_name):
# def root_put_object_with_bucket(bucket_name, object_name):
# def list_retry_tests():
# def create_retry_test():
# def get_retry_test(test_id):
# def delete_retry_test(test_id):
# def start_grpc():
# def bucket_list():
# def bucket_insert():
# def bucket_get(bucket_name):
# def bucket_update(bucket_name):
# def bucket_patch(bucket_name):
# def bucket_delete(bucket_name):
# def bucket_acl_list(bucket_name):
# def bucket_acl_insert(bucket_name):
# def bucket_acl_get(bucket_name, entity):
# def bucket_acl_update(bucket_name, entity):
# def bucket_acl_patch(bucket_name, entity):
# def bucket_acl_delete(bucket_name, entity):
# def bucket_default_object_acl_list(bucket_name):
# def bucket_default_object_acl_insert(bucket_name):
# def bucket_default_object_acl_get(bucket_name, entity):
# def bucket_default_object_acl_update(bucket_name, entity):
# def bucket_default_object_acl_patch(bucket_name, entity):
# def bucket_default_object_acl_delete(bucket_name, entity):
# def bucket_notification_list(bucket_name):
# def bucket_notification_insert(bucket_name):
# def bucket_notification_get(bucket_name, notification_id):
# def bucket_notification_delete(bucket_name, notification_id):
# def bucket_get_iam_policy(bucket_name):
# def bucket_set_iam_policy(bucket_name):
# def bucket_test_iam_permissions(bucket_name):
# def bucket_lock_retention_policy(bucket_name):
# def object_list(bucket_name):
# def object_update(bucket_name, object_name):
# def object_patch(bucket_name, object_name):
# def object_delete(bucket_name, object_name):
# def object_get(bucket_name, object_name):
# def objects_compose(bucket_name, object_name):
#         def precondition(_, live_version, ctx):
# def objects_copy(src_bucket_name, src_object_name, dst_bucket_name, dst_object_name):
# def objects_rewrite(src_bucket_name, src_object_name, dst_bucket_name, dst_object_name):
# def object_acl_list(bucket_name, object_name):
# def object_acl_insert(bucket_name, object_name):
# def object_acl_get(bucket_name, object_name, entity):
# def object_acl_update(bucket_name, object_name, entity):
# def object_acl_patch(bucket_name, object_name, entity):
# def object_acl_delete(bucket_name, object_name, entity):
# def download_object_get(bucket_name, object_name):
# def object_insert(bucket_name):
# def resumable_upload_chunk(bucket_name):
# def delete_resumable_upload(bucket_name):
# def _run():
# def _main():
# GCS_HANDLER_PATH = "/storage/v1"
# DOWNLOAD_HANDLER_PATH = "/download/storage/v1"
# UPLOAD_HANDLER_PATH = "/upload/storage/v1"


# Path: tests/test_testbench_bucket.py
import json
import os
import unittest
from testbench import rest_server

#!/usr/bin/env python3
#
# Copyright 2021 Google LLC
#
# 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.

"""Unit test for bucket operations in the testbench."""




class TestTestbenchBucket(unittest.TestCase):
    def setUp(self):
        rest_server.db.clear()

        self.client = rest_server.server.test_client()