# 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/resource.py
# class ResourceShow(command.ShowOne):
# class ResourceList(command.Lister):
# class ResourceMetadata(format_utils.JsonFormat):
# class ResourceSignal(command.Command):
# class ResourceMarkUnhealthy(command.Command):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def formatter_namespace(self):
#     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 _resource_metadata(heat_client, args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
# def _resource_signal(heat_client, 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/resources.py
# DEFAULT_PAGE_SIZE = 20
# class Resource(base.Resource):
# class ResourceManager(stacks.StackChildManager):
#     def __repr__(self):
#     def update(self, **fields):
#     def delete(self):
#     def data(self, **kwargs):
#     def stack_name(self):
#     def list(self, stack_id, **kwargs):
#     def get(self, stack_id, resource_name, with_attr=None):
#     def metadata(self, stack_id, resource_name):
#     def signal(self, stack_id, resource_name, data=None):
#     def mark_unhealthy(self, stack_id, resource_name,
#                        mark_unhealthy, resource_status_reason):
#     def generate_template(self, resource_name):


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 resource
from heatclient.tests.unit.osc.v1 import fakes as orchestration_fakes
from heatclient.v1 import resources as v1_resources
    def setUp(self):
        super(TestResourceMarkUnhealthy, self).setUp()
        self.cmd = resource.ResourceMarkUnhealthy(self.app, None)
        self.resource_client.mark_unhealthy = mock.Mock()

    def test_resource_mark_unhealthy(self):
        arglist = ['my_stack', 'my_resource', 'reason']
        parsed_args = self.check_parser(self.cmd, arglist, [])
        self.cmd.take_action(parsed_args)
        self.resource_client.mark_unhealthy.assert_called_with(**{
            "stack_id": "my_stack",
            "resource_name": "my_resource",
            "mark_unhealthy": True,
            "resource_status_reason": "reason"
        })

    def test_resource_mark_unhealthy_reset(self):
        arglist = ['my_stack', 'my_resource', '--reset']
        parsed_args = self.check_parser(self.cmd, arglist, [])
        self.cmd.take_action(parsed_args)
        self.resource_client.mark_unhealthy.assert_called_with(**{
            "stack_id": "my_stack",
            "resource_name": "my_resource",
            "mark_unhealthy": False,
            "resource_status_reason": ""
        })

    def test_resource_mark_unhealthy_not_found(self):
        arglist = ['my_stack', 'my_resource', '--reset']
        self.resource_client.mark_unhealthy.side_effect = (

# 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/resource.py
# class ResourceShow(command.ShowOne):
# class ResourceList(command.Lister):
# class ResourceMetadata(format_utils.JsonFormat):
# class ResourceSignal(command.Command):
# class ResourceMarkUnhealthy(command.Command):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def formatter_namespace(self):
#     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 _resource_metadata(heat_client, args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
# def _resource_signal(heat_client, 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/resources.py
# DEFAULT_PAGE_SIZE = 20
# class Resource(base.Resource):
# class ResourceManager(stacks.StackChildManager):
#     def __repr__(self):
#     def update(self, **fields):
#     def delete(self):
#     def data(self, **kwargs):
#     def stack_name(self):
#     def list(self, stack_id, **kwargs):
#     def get(self, stack_id, resource_name, with_attr=None):
#     def metadata(self, stack_id, resource_name):
#     def signal(self, stack_id, resource_name, data=None):
#     def mark_unhealthy(self, stack_id, resource_name,
#                        mark_unhealthy, resource_status_reason):
#     def generate_template(self, resource_name):


# Path: heatclient/tests/unit/osc/v1/test_resource.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 resource
from heatclient.tests.unit.osc.v1 import fakes as orchestration_fakes
from heatclient.v1 import resources as v1_resources

    def setUp(self):
        super(TestResourceMarkUnhealthy, self).setUp()
        self.cmd = resource.ResourceMarkUnhealthy(self.app, None)
        self.resource_client.mark_unhealthy = mock.Mock()

    def test_resource_mark_unhealthy(self):
        arglist = ['my_stack', 'my_resource', 'reason']
        parsed_args = self.check_parser(self.cmd, arglist, [])
        self.cmd.take_action(parsed_args)
        self.resource_client.mark_unhealthy.assert_called_with(**{
            "stack_id": "my_stack",
            "resource_name": "my_resource",
            "mark_unhealthy": True,
            "resource_status_reason": "reason"
        })

    def test_resource_mark_unhealthy_reset(self):
        arglist = ['my_stack', 'my_resource', '--reset']
        parsed_args = self.check_parser(self.cmd, arglist, [])
        self.cmd.take_action(parsed_args)
        self.resource_client.mark_unhealthy.assert_called_with(**{
            "stack_id": "my_stack",
            "resource_name": "my_resource",
            "mark_unhealthy": False,
            "resource_status_reason": ""
        })

    def test_resource_mark_unhealthy_not_found(self):
        arglist = ['my_stack', 'my_resource', '--reset']
        self.resource_client.mark_unhealthy.side_effect = (

            heat_exc.HTTPNotFound)