# 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/osc/v1/software_deployment.py
# class CreateDeployment(format_utils.YamlFormat):
# class DeleteDeployment(command.Command):
# class ListDeployment(command.Lister):
# class ShowDeployment(command.ShowOne):
# class ShowMetadataDeployment(command.Command):
# class ShowOutputDeployment(command.Command):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
# def _list_deployment(heat_client, args=None):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
# 
# Path: heatclient/tests/unit/osc/v1/fakes.py
# class TestOrchestrationv1(utils.TestCommand):
#     def setUp(self):
# 
# 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/v1/software_deployments.py
# class SoftwareDeployment(base.Resource):
# class SoftwareDeploymentManager(base.BaseManager):
#     def __repr__(self):
#     def update(self, **fields):
#     def delete(self):
#     def list(self, **kwargs):
#     def metadata(self, server_id):
#     def get(self, deployment_id):
#     def create(self, **kwargs):
#     def update(self, deployment_id, **kwargs):
#     def delete(self, deployment_id):


import copy
from unittest import mock
from osc_lib import exceptions as exc
from heatclient import exc as heat_exc
from heatclient.osc.v1 import software_deployment
from heatclient.tests.unit.osc.v1 import fakes as orchestration_fakes
from heatclient.v1 import software_configs
from heatclient.v1 import software_deployments
        columns, data = self.cmd.take_action(parsed_args)

        self.config_client.create.assert_called_with(**config)
        self.sd_client.create.assert_called_with(**deploy)


class TestDeploymentDelete(TestDeployment):

    def setUp(self):
        super(TestDeploymentDelete, self).setUp()
        self.cmd = software_deployment.DeleteDeployment(self.app, None)

    def test_deployment_delete_success(self):
        arglist = ['test_deployment']
        parsed_args = self.check_parser(self.cmd, arglist, [])
        self.cmd.take_action(parsed_args)
        self.sd_client.delete.assert_called_with(
            deployment_id='test_deployment')

    def test_deployment_delete_multiple(self):
        arglist = ['test_deployment', 'test_deployment2']
        parsed_args = self.check_parser(self.cmd, arglist, [])
        self.cmd.take_action(parsed_args)
        self.sd_client.delete.assert_has_calls(
            [mock.call(deployment_id='test_deployment'),
             mock.call(deployment_id='test_deployment2')])

    def test_deployment_delete_not_found(self):
        arglist = ['test_deployment', 'test_deployment2']
        parsed_args = self.check_parser(self.cmd, arglist, [])

# 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/osc/v1/software_deployment.py
# class CreateDeployment(format_utils.YamlFormat):
# class DeleteDeployment(command.Command):
# class ListDeployment(command.Lister):
# class ShowDeployment(command.ShowOne):
# class ShowMetadataDeployment(command.Command):
# class ShowOutputDeployment(command.Command):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
# def _list_deployment(heat_client, args=None):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
# 
# Path: heatclient/tests/unit/osc/v1/fakes.py
# class TestOrchestrationv1(utils.TestCommand):
#     def setUp(self):
# 
# 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/v1/software_deployments.py
# class SoftwareDeployment(base.Resource):
# class SoftwareDeploymentManager(base.BaseManager):
#     def __repr__(self):
#     def update(self, **fields):
#     def delete(self):
#     def list(self, **kwargs):
#     def metadata(self, server_id):
#     def get(self, deployment_id):
#     def create(self, **kwargs):
#     def update(self, deployment_id, **kwargs):
#     def delete(self, deployment_id):


# Path: heatclient/tests/unit/osc/v1/test_software_deployment.py
import copy
from unittest import mock
from osc_lib import exceptions as exc
from heatclient import exc as heat_exc
from heatclient.osc.v1 import software_deployment
from heatclient.tests.unit.osc.v1 import fakes as orchestration_fakes
from heatclient.v1 import software_configs
from heatclient.v1 import software_deployments

        columns, data = self.cmd.take_action(parsed_args)

        self.config_client.create.assert_called_with(**config)
        self.sd_client.create.assert_called_with(**deploy)


class TestDeploymentDelete(TestDeployment):

    def setUp(self):
        super(TestDeploymentDelete, self).setUp()
        self.cmd = software_deployment.DeleteDeployment(self.app, None)

    def test_deployment_delete_success(self):
        arglist = ['test_deployment']
        parsed_args = self.check_parser(self.cmd, arglist, [])
        self.cmd.take_action(parsed_args)
        self.sd_client.delete.assert_called_with(
            deployment_id='test_deployment')

    def test_deployment_delete_multiple(self):
        arglist = ['test_deployment', 'test_deployment2']
        parsed_args = self.check_parser(self.cmd, arglist, [])
        self.cmd.take_action(parsed_args)
        self.sd_client.delete.assert_has_calls(
            [mock.call(deployment_id='test_deployment'),
             mock.call(deployment_id='test_deployment2')])

    def test_deployment_delete_not_found(self):
        arglist = ['test_deployment', 'test_deployment2']
        parsed_args = self.check_parser(self.cmd, arglist, [])

        self.sd_client.delete.side_effect = heat_exc.HTTPNotFound()