# Path: heatclient/common/deployment_utils.py
# def build_derived_config_params(action, source, name, input_values,
#                                 server_id, signal_transport, signal_id=None):
# def create_temp_url(swift_client, name, timeout, container=None):
# def build_signal_id(hc, args):
# def create_swift_client(auth, session, args):
# 
# Path: heatclient/exc.py
# class BaseException(Exception):
# class CommandError(BaseException):
# class InvalidEndpoint(BaseException):
# class CommunicationError(BaseException):
# class HTTPException(BaseException):
# class HTTPMultipleChoices(HTTPException):
# class BadRequest(HTTPException):
# class HTTPBadRequest(BadRequest):
# class Unauthorized(HTTPException):
# class HTTPUnauthorized(Unauthorized):
# class Forbidden(HTTPException):
# class HTTPForbidden(Forbidden):
# class NotFound(HTTPException):
# class HTTPNotFound(NotFound):
# class NoUniqueMatch(HTTPException):
# class HTTPMethodNotAllowed(HTTPException):
# class Conflict(HTTPException):
# class HTTPConflict(Conflict):
# class OverLimit(HTTPException):
# class HTTPOverLimit(OverLimit):
# class HTTPUnsupported(HTTPException):
# class HTTPInternalServerError(HTTPException):
# class HTTPNotImplemented(HTTPException):
# class HTTPBadGateway(HTTPException):
# class ServiceUnavailable(HTTPException):
# class HTTPServiceUnavailable(ServiceUnavailable):
# class NoTokenLookupException(Exception):
# class EndpointNotFound(Exception):
# class StackFailure(Exception):
#     def __init__(self, message=None):
#     def __str__(self):
#     def __init__(self, message=None, code=None):
#     def __str__(self):
#     def __str__(self):
# def from_response(response):
# 
# Path: heatclient/v1/software_configs.py
# class SoftwareConfig(base.Resource):
# class SoftwareConfigManager(base.BaseManager):
#     def __repr__(self):
#     def delete(self):
#     def data(self, **kwargs):
#     def list(self, **kwargs):
#     def get(self, config_id):
#     def create(self, **kwargs):
#     def delete(self, config_id):


from unittest import mock
from testtools import matchers
from heatclient.common import deployment_utils
from heatclient import exc
from heatclient.v1 import software_configs
import six
import swiftclient.client
import testscenarios
import testtools
        head_account = {}

        def post_account(data):
            head_account.update(data)

        swift_client.head_account = mock.Mock(return_value=head_account)
        swift_client.post_account = post_account

        self.assertNotIn('x-account-meta-temp-url-key', head_account)
        deployment_utils.create_temp_url(swift_client, 'bar', 60, 'foo')
        self.assertIn('x-account-meta-temp-url-key', head_account)

    def test_build_signal_id_no_signal(self):
        hc = mock.MagicMock()
        args = mock.MagicMock()
        args.signal_transport = 'NO_SIGNAL'
        self.assertIsNone(deployment_utils.build_signal_id(hc, args))

    def test_build_signal_id_no_client_auth(self):
        hc = mock.MagicMock()
        args = mock.MagicMock()
        args.os_no_client_auth = True
        args.signal_transport = 'TEMP_URL_SIGNAL'
        e = self.assertRaises(exc.CommandError,
                              deployment_utils.build_signal_id, hc, args)
        self.assertEqual((
            'Cannot use --os-no-client-auth, auth required to create '
            'a Swift TempURL.'),
            six.text_type(e))


# Path: heatclient/common/deployment_utils.py
# def build_derived_config_params(action, source, name, input_values,
#                                 server_id, signal_transport, signal_id=None):
# def create_temp_url(swift_client, name, timeout, container=None):
# def build_signal_id(hc, args):
# def create_swift_client(auth, session, args):
# 
# Path: heatclient/exc.py
# class BaseException(Exception):
# class CommandError(BaseException):
# class InvalidEndpoint(BaseException):
# class CommunicationError(BaseException):
# class HTTPException(BaseException):
# class HTTPMultipleChoices(HTTPException):
# class BadRequest(HTTPException):
# class HTTPBadRequest(BadRequest):
# class Unauthorized(HTTPException):
# class HTTPUnauthorized(Unauthorized):
# class Forbidden(HTTPException):
# class HTTPForbidden(Forbidden):
# class NotFound(HTTPException):
# class HTTPNotFound(NotFound):
# class NoUniqueMatch(HTTPException):
# class HTTPMethodNotAllowed(HTTPException):
# class Conflict(HTTPException):
# class HTTPConflict(Conflict):
# class OverLimit(HTTPException):
# class HTTPOverLimit(OverLimit):
# class HTTPUnsupported(HTTPException):
# class HTTPInternalServerError(HTTPException):
# class HTTPNotImplemented(HTTPException):
# class HTTPBadGateway(HTTPException):
# class ServiceUnavailable(HTTPException):
# class HTTPServiceUnavailable(ServiceUnavailable):
# class NoTokenLookupException(Exception):
# class EndpointNotFound(Exception):
# class StackFailure(Exception):
#     def __init__(self, message=None):
#     def __str__(self):
#     def __init__(self, message=None, code=None):
#     def __str__(self):
#     def __str__(self):
# def from_response(response):
# 
# Path: heatclient/v1/software_configs.py
# class SoftwareConfig(base.Resource):
# class SoftwareConfigManager(base.BaseManager):
#     def __repr__(self):
#     def delete(self):
#     def data(self, **kwargs):
#     def list(self, **kwargs):
#     def get(self, config_id):
#     def create(self, **kwargs):
#     def delete(self, config_id):


# Path: heatclient/tests/unit/test_deployment_utils.py
from unittest import mock
from testtools import matchers
from heatclient.common import deployment_utils
from heatclient import exc
from heatclient.v1 import software_configs
import six
import swiftclient.client
import testscenarios
import testtools

        head_account = {}

        def post_account(data):
            head_account.update(data)

        swift_client.head_account = mock.Mock(return_value=head_account)
        swift_client.post_account = post_account

        self.assertNotIn('x-account-meta-temp-url-key', head_account)
        deployment_utils.create_temp_url(swift_client, 'bar', 60, 'foo')
        self.assertIn('x-account-meta-temp-url-key', head_account)

    def test_build_signal_id_no_signal(self):
        hc = mock.MagicMock()
        args = mock.MagicMock()
        args.signal_transport = 'NO_SIGNAL'
        self.assertIsNone(deployment_utils.build_signal_id(hc, args))

    def test_build_signal_id_no_client_auth(self):
        hc = mock.MagicMock()
        args = mock.MagicMock()
        args.os_no_client_auth = True
        args.signal_transport = 'TEMP_URL_SIGNAL'
        e = self.assertRaises(exc.CommandError,
                              deployment_utils.build_signal_id, hc, args)
        self.assertEqual((
            'Cannot use --os-no-client-auth, auth required to create '
            'a Swift TempURL.'),
            six.text_type(e))


    @mock.patch.object(deployment_utils, 'create_temp_url')