# coding=utf8

# Copyright 2018 JDCLOUD.COM
#
# 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.
#
# NOTE: This class is auto generated by the jdcloud code generator program.

import unittest
import os
import json


class ApigatewayTest(unittest.TestCase):

    def test_query_user_domains(self):
        cmd = """python ../../main.py apigateway query-user-domains  --api-group-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_create_user_domain(self):
        cmd = """python ../../main.py apigateway create-user-domain  --domain 'xxx' --api-group-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_delete_user_domain(self):
        cmd = """python ../../main.py apigateway delete-user-domain  --domain-ids 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_create_backend_config(self):
        cmd = """python ../../main.py apigateway create-backend-config  --api-group-id 'xxx' --environment 'xxx' --backend-service-type 'xxx' --sort '5'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_describe_backend_configs(self):
        cmd = """python ../../main.py apigateway describe-backend-configs  --api-group-id 'xxx' --environment 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_describe_backend_config(self):
        cmd = """python ../../main.py apigateway describe-backend-config  --api-group-id 'xxx' --backend-config-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_update_backend_config(self):
        cmd = """python ../../main.py apigateway update-backend-config  --api-group-id 'xxx' --backend-config-id 'xxx' --environment 'xxx' --backend-service-type 'xxx' --sort '5'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_delete_backend_config(self):
        cmd = """python ../../main.py apigateway delete-backend-config  --api-group-id 'xxx' --backend-config-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_query_uc_access_keys(self):
        cmd = """python ../../main.py apigateway query-uc-access-keys """
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_query_keys(self):
        cmd = """python ../../main.py apigateway query-keys """
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_create_key(self):
        cmd = """python ../../main.py apigateway create-key """
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_reset_key(self):
        cmd = """python ../../main.py apigateway reset-key  --key-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_update_key(self):
        cmd = """python ../../main.py apigateway update-key  --key-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_query_key_info(self):
        cmd = """python ../../main.py apigateway query-key-info  --key-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_describe_api_groups(self):
        cmd = """python ../../main.py apigateway describe-api-groups """
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_create_api_group(self):
        cmd = """python ../../main.py apigateway create-api-group  --group-name 'xxx' --auth-type 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_check_group_name_exist(self):
        cmd = """python ../../main.py apigateway check-group-name-exist  --group-name 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_describe_api_group(self):
        cmd = """python ../../main.py apigateway describe-api-group  --api-group-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_modify_api_group_attribute(self):
        cmd = """python ../../main.py apigateway modify-api-group-attribute  --api-group-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_delete_api_group(self):
        cmd = """python ../../main.py apigateway delete-api-group  --api-group-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_describe_is_deploy_api_groups(self):
        cmd = """python ../../main.py apigateway describe-is-deploy-api-groups """
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_query_rate_limit_policies(self):
        cmd = """python ../../main.py apigateway query-rate-limit-policies """
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_create_rate_limit_policy(self):
        cmd = """python ../../main.py apigateway create-rate-limit-policy """
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_check_policy_name(self):
        cmd = """python ../../main.py apigateway check-policy-name  --policy-name 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_query_rate_limit_policy(self):
        cmd = """python ../../main.py apigateway query-rate-limit-policy  --policy-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_update_rate_limit_policy(self):
        cmd = """python ../../main.py apigateway update-rate-limit-policy  --policy-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_delete_rate_limit_policy(self):
        cmd = """python ../../main.py apigateway delete-rate-limit-policy  --policy-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_query_bind_group_policy(self):
        cmd = """python ../../main.py apigateway query-bind-group-policy  --policy-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_bind_group_policy(self):
        cmd = """python ../../main.py apigateway bind-group-policy  --policy-id 'xxx' --deployment-ids 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_query_policy_group_list(self):
        cmd = """python ../../main.py apigateway query-policy-group-list  --policy-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_query_subscription_keys(self):
        cmd = """python ../../main.py apigateway query-subscription-keys """
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_create_subscription_key(self):
        cmd = """python ../../main.py apigateway create-subscription-key """
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_query_subscription_key(self):
        cmd = """python ../../main.py apigateway query-subscription-key  --subscription-key-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_update_subscription_key(self):
        cmd = """python ../../main.py apigateway update-subscription-key  --subscription-key-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_delete_subscription_key(self):
        cmd = """python ../../main.py apigateway delete-subscription-key  --subscription-key-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_query_access_keys(self):
        cmd = """python ../../main.py apigateway query-access-keys """
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_create_access_key(self):
        cmd = """python ../../main.py apigateway create-access-key """
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_check_key_exist(self):
        cmd = """python ../../main.py apigateway check-key-exist  --access-key 'xxx' --access-key-type 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_query_access_key(self):
        cmd = """python ../../main.py apigateway query-access-key  --access-key-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_update_access_key(self):
        cmd = """python ../../main.py apigateway update-access-key  --access-key-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_delete_access_key(self):
        cmd = """python ../../main.py apigateway delete-access-key  --access-key-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_query_bind_group_key(self):
        cmd = """python ../../main.py apigateway query-bind-group-key  --access-key-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_bind_group_key(self):
        cmd = """python ../../main.py apigateway bind-group-key  --access-key-id 'xxx' --deployment-ids 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_query_key_group_list(self):
        cmd = """python ../../main.py apigateway query-key-group-list  --access-key-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_check_pin(self):
        cmd = """python ../../main.py apigateway check-pin  --pin 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_query_apis(self):
        cmd = """python ../../main.py apigateway query-apis  --api-group-id 'xxx' --revision 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_create_apis(self):
        cmd = """python ../../main.py apigateway create-apis  --api-group-id 'xxx' --revision 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_check_api_name_exist(self):
        cmd = """python ../../main.py apigateway check-api-name-exist  --api-group-id 'xxx' --revision 'xxx' --api-name 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_query_api(self):
        cmd = """python ../../main.py apigateway query-api  --api-group-id 'xxx' --revision 'xxx' --api-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_update_api(self):
        cmd = """python ../../main.py apigateway update-api  --api-group-id 'xxx' --revision 'xxx' --api-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_delete_api(self):
        cmd = """python ../../main.py apigateway delete-api  --api-group-id 'xxx' --revision 'xxx' --api-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_update_api_by_name(self):
        cmd = """python ../../main.py apigateway update-api-by-name  --api-group-id 'xxx' --revision 'xxx' --api-name 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_delete_api_by_name(self):
        cmd = """python ../../main.py apigateway delete-api-by-name  --api-group-id 'xxx' --revision 'xxx' --api-name 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_describe_deployments(self):
        cmd = """python ../../main.py apigateway describe-deployments  --api-group-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_deploy(self):
        cmd = """python ../../main.py apigateway deploy  --api-group-id 'xxx' --revision 'xxx' --environment 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_describe_deployment(self):
        cmd = """python ../../main.py apigateway describe-deployment  --api-group-id 'xxx' --deployment-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_offline(self):
        cmd = """python ../../main.py apigateway offline  --api-group-id 'xxx' --deployment-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_batch_offline(self):
        cmd = """python ../../main.py apigateway batch-offline  --api-group-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_describe_revisions(self):
        cmd = """python ../../main.py apigateway describe-revisions  --api-group-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_create_revision(self):
        cmd = """python ../../main.py apigateway create-revision  --api-group-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_get_revision_ids(self):
        cmd = """python ../../main.py apigateway get-revision-ids  --api-group-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_check_revision_exist(self):
        cmd = """python ../../main.py apigateway check-revision-exist  --api-group-id 'xxx' --revision 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_query_revision(self):
        cmd = """python ../../main.py apigateway query-revision  --api-group-id 'xxx' --revision-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_modify_revision(self):
        cmd = """python ../../main.py apigateway modify-revision  --api-group-id 'xxx' --revision-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_delete_revision(self):
        cmd = """python ../../main.py apigateway delete-revision  --api-group-id 'xxx' --revision-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_query_access_auths(self):
        cmd = """python ../../main.py apigateway query-access-auths """
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_create_access_auth(self):
        cmd = """python ../../main.py apigateway create-access-auth """
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_check_auth_exist(self):
        cmd = """python ../../main.py apigateway check-auth-exist  --access-key 'xxx' --auth-user-type 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_query_access_auth(self):
        cmd = """python ../../main.py apigateway query-access-auth  --access-auth-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_update_access_auth(self):
        cmd = """python ../../main.py apigateway update-access-auth  --access-auth-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_delete_access_auth(self):
        cmd = """python ../../main.py apigateway delete-access-auth  --access-auth-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_query_bind_group_auth(self):
        cmd = """python ../../main.py apigateway query-bind-group-auth  --access-auth-id 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_bind_group_auth(self):
        cmd = """python ../../main.py apigateway bind-group-auth  --access-auth-id 'xxx' --deployment-ids 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_query_auth_group_list(self):
        cmd = """python ../../main.py apigateway query-auth-group-list  --auth-user-type 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_authorized_api_group_list(self):
        cmd = """python ../../main.py apigateway authorized-api-group-list """
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

