# 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/snapshot.py
# class ListSnapshot(command.Lister):
# class ShowSnapshot(format_utils.YamlFormat):
# class RestoreSnapshot(command.Command):
# class CreateSnapshot(command.ShowOne):
# class DeleteSnapshot(command.Command):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def _list_snapshot(self, heat_client, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def _show_snapshot(self, heat_client, stack_id, snapshot_id):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def _restore_snapshot(self, heat_client, 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):


from unittest import mock
from osc_lib import exceptions as exc
from heatclient import exc as heat_exc
from heatclient.osc.v1 import snapshot
from heatclient.tests.unit.osc.v1 import fakes as orchestration_fakes
import six
        "name": "test_snapshot",
        "status_reason": None,
        "creation_time": "2015-11-09T04:35:38.534130",
        "data": None,
        "id": "108604fe-6d13-41b7-aa3a-79b6cf60c4ff"
    }

    def setUp(self):
        super(TestSnapshotCreate, self).setUp()
        self.cmd = snapshot.CreateSnapshot(self.app, None)

    def test_snapshot_create(self):
        arglist = ['my_stack', '--name', 'test_snapshot']
        parsed_args = self.check_parser(self.cmd, arglist, [])
        self.stack_client.snapshot.return_value = self.get_response
        self.cmd.take_action(parsed_args)
        self.stack_client.snapshot.assert_called_with(
            'my_stack', 'test_snapshot')

    def test_snapshot_create_no_name(self):
        arglist = ['my_stack']
        parsed_args = self.check_parser(self.cmd, arglist, [])
        self.stack_client.snapshot.return_value = self.get_response
        self.cmd.take_action(parsed_args)
        self.stack_client.snapshot.assert_called_with(
            'my_stack', None)

    def test_snapshot_create_error(self):
        arglist = ['my_stack', '--name', 'test_snapshot']
        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/snapshot.py
# class ListSnapshot(command.Lister):
# class ShowSnapshot(format_utils.YamlFormat):
# class RestoreSnapshot(command.Command):
# class CreateSnapshot(command.ShowOne):
# class DeleteSnapshot(command.Command):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def _list_snapshot(self, heat_client, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def _show_snapshot(self, heat_client, stack_id, snapshot_id):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def _restore_snapshot(self, heat_client, 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/tests/unit/osc/v1/test_snapshot.py
from unittest import mock
from osc_lib import exceptions as exc
from heatclient import exc as heat_exc
from heatclient.osc.v1 import snapshot
from heatclient.tests.unit.osc.v1 import fakes as orchestration_fakes
import six

        "name": "test_snapshot",
        "status_reason": None,
        "creation_time": "2015-11-09T04:35:38.534130",
        "data": None,
        "id": "108604fe-6d13-41b7-aa3a-79b6cf60c4ff"
    }

    def setUp(self):
        super(TestSnapshotCreate, self).setUp()
        self.cmd = snapshot.CreateSnapshot(self.app, None)

    def test_snapshot_create(self):
        arglist = ['my_stack', '--name', 'test_snapshot']
        parsed_args = self.check_parser(self.cmd, arglist, [])
        self.stack_client.snapshot.return_value = self.get_response
        self.cmd.take_action(parsed_args)
        self.stack_client.snapshot.assert_called_with(
            'my_stack', 'test_snapshot')

    def test_snapshot_create_no_name(self):
        arglist = ['my_stack']
        parsed_args = self.check_parser(self.cmd, arglist, [])
        self.stack_client.snapshot.return_value = self.get_response
        self.cmd.take_action(parsed_args)
        self.stack_client.snapshot.assert_called_with(
            'my_stack', None)

    def test_snapshot_create_error(self):
        arglist = ['my_stack', '--name', 'test_snapshot']
        parsed_args = self.check_parser(self.cmd, arglist, [])

        self.stack_client.snapshot.side_effect = heat_exc.HTTPNotFound