# Path: cloudify_gcp/tests/test_utils.py
# class NS(object):
#     """Simple namespace helper"""
# 
#     reason = 'No reason needed for these tests'
# 
#     def __init__(self, **kwargs):
#         for k, v in kwargs.items():
#             setattr(self, k, v)
# 
# Path: cloudify_gcp/gcp.py
# def check_response(func):
#     def _decorator(self, *args, **kwargs):
#     def __init__(self, config, logger,
#                  scope=constants.COMPUTE_SCOPE,
#                  discovery=constants.COMPUTE_DISCOVERY,
#                  api_version=constants.API_V1):
#     def discovery(self):
#     def get_credentials(self, scope):
#     def create_discovery(self, discovery, scope, api_version):
#     def __init__(self, config, logger, name,
#                  additional_settings=None,
#                  scope=constants.COMPUTE_SCOPE,
#                  discovery=constants.COMPUTE_DISCOVERY,
#                  api_version=constants.API_V1):
#     def get_credentials(self, scope):
#     def get_common_instance_metadata(self):
#     def ZONES(self):
#     def __init__(self, message):
# def is_missing_resource_error(error):
# def is_resource_used_error(error):
# class GoogleCloudApi(object):
# class GoogleCloudPlatform(GoogleCloudApi):
# class GCPError(Exception):


import unittest
from mock import MagicMock, patch
from googleapiclient.errors import HttpError
from cloudify_gcp.tests.test_utils import NS
from cloudify_gcp import gcp
#        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.

from __future__ import print_function





class TestGCP(unittest.TestCase):

    def test_check_response_decorator(self):

        class TestClass(object):

            def __init__(self):
                self.logger = MagicMock()

            @gcp.check_response
            def test_function(self, response):
                return response

        TestClass().test_function({})

        instance = TestClass()

# Path: cloudify_gcp/tests/test_utils.py
# class NS(object):
#     """Simple namespace helper"""
# 
#     reason = 'No reason needed for these tests'
# 
#     def __init__(self, **kwargs):
#         for k, v in kwargs.items():
#             setattr(self, k, v)
# 
# Path: cloudify_gcp/gcp.py
# def check_response(func):
#     def _decorator(self, *args, **kwargs):
#     def __init__(self, config, logger,
#                  scope=constants.COMPUTE_SCOPE,
#                  discovery=constants.COMPUTE_DISCOVERY,
#                  api_version=constants.API_V1):
#     def discovery(self):
#     def get_credentials(self, scope):
#     def create_discovery(self, discovery, scope, api_version):
#     def __init__(self, config, logger, name,
#                  additional_settings=None,
#                  scope=constants.COMPUTE_SCOPE,
#                  discovery=constants.COMPUTE_DISCOVERY,
#                  api_version=constants.API_V1):
#     def get_credentials(self, scope):
#     def get_common_instance_metadata(self):
#     def ZONES(self):
#     def __init__(self, message):
# def is_missing_resource_error(error):
# def is_resource_used_error(error):
# class GoogleCloudApi(object):
# class GoogleCloudPlatform(GoogleCloudApi):
# class GCPError(Exception):


# Path: cloudify_gcp/tests/test_gcp.py
import unittest
from mock import MagicMock, patch
from googleapiclient.errors import HttpError
from cloudify_gcp.tests.test_utils import NS
from cloudify_gcp import gcp

#        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.

from __future__ import print_function





class TestGCP(unittest.TestCase):

    def test_check_response_decorator(self):

        class TestClass(object):

            def __init__(self):
                self.logger = MagicMock()

            @gcp.check_response
            def test_function(self, response):
                return response

        TestClass().test_function({})

        instance = TestClass()

        with self.assertRaises(gcp.GCPError):