# Path: muranoclient/osc/v1/deployment.py
# LOG = logging.getLogger(__name__)
# class ListDeployment(command.Lister):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
# 
# Path: muranoclient/tests/unit/osc/v1/fakes.py
# class TestApplicationCatalog(utils.TestCommand):
#     def setUp(self):
# 
# Path: muranoclient/v1/deployments.py
# class Deployment(base.Resource):
# class Status(base.Resource):
# class DeploymentManager(base.Manager):
#     def __repr__(self):
#     def data(self, **kwargs):
#     def __repr__(self):
#     def data(self, **kwargs):
#     def list(self, environment_id, all_environments=False):
#     def reports(self, environment_id, deployment_id, *service_ids):


from unittest import mock
from muranoclient.osc.v1 import deployment as osc_deployment
from muranoclient.tests.unit.osc.v1 import fakes
from muranoclient.v1 import deployments as api_deployment
    def setUp(self):
        super(TestListDeployment, self).setUp()
        deployment_info = dict(zip(DEPLOYMENT_COLUMNS, DEPLOYMENT_DATA))
        self.deployment_mock.list.return_value = \
            [api_deployment.Deployment(None, deployment_info)]

        # Command to test
        self.cmd = osc_deployment.ListDeployment(self.app, None)

    @mock.patch('osc_lib.utils.get_item_properties')
    def test_deployment_list(self, mock_util):
        arglist = ['xyz123']
        verifylist = [('id', 'xyz123')]
        mock_util.return_value = DEPLOYMENT_DATA

        parsed_args = self.check_parser(self.cmd, arglist, verifylist)

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

        # Check that columns are correct
        expected_columns = [c.title() for c in DEPLOYMENT_COLUMNS]
        self.assertEqual(expected_columns, columns)

        # Check that data is correct
        expected_data = [DEPLOYMENT_DATA]
        self.assertEqual(expected_data, data)

    @mock.patch('osc_lib.utils.get_item_properties', autospec=True)
    def test_deployment_list_all_environments(self, mock_util):
        arglist = ['--all-environments']

# Path: muranoclient/osc/v1/deployment.py
# LOG = logging.getLogger(__name__)
# class ListDeployment(command.Lister):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
# 
# Path: muranoclient/tests/unit/osc/v1/fakes.py
# class TestApplicationCatalog(utils.TestCommand):
#     def setUp(self):
# 
# Path: muranoclient/v1/deployments.py
# class Deployment(base.Resource):
# class Status(base.Resource):
# class DeploymentManager(base.Manager):
#     def __repr__(self):
#     def data(self, **kwargs):
#     def __repr__(self):
#     def data(self, **kwargs):
#     def list(self, environment_id, all_environments=False):
#     def reports(self, environment_id, deployment_id, *service_ids):


# Path: muranoclient/tests/unit/osc/v1/test_deployment.py
from unittest import mock
from muranoclient.osc.v1 import deployment as osc_deployment
from muranoclient.tests.unit.osc.v1 import fakes
from muranoclient.v1 import deployments as api_deployment

    def setUp(self):
        super(TestListDeployment, self).setUp()
        deployment_info = dict(zip(DEPLOYMENT_COLUMNS, DEPLOYMENT_DATA))
        self.deployment_mock.list.return_value = \
            [api_deployment.Deployment(None, deployment_info)]

        # Command to test
        self.cmd = osc_deployment.ListDeployment(self.app, None)

    @mock.patch('osc_lib.utils.get_item_properties')
    def test_deployment_list(self, mock_util):
        arglist = ['xyz123']
        verifylist = [('id', 'xyz123')]
        mock_util.return_value = DEPLOYMENT_DATA

        parsed_args = self.check_parser(self.cmd, arglist, verifylist)

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

        # Check that columns are correct
        expected_columns = [c.title() for c in DEPLOYMENT_COLUMNS]
        self.assertEqual(expected_columns, columns)

        # Check that data is correct
        expected_data = [DEPLOYMENT_DATA]
        self.assertEqual(expected_data, data)

    @mock.patch('osc_lib.utils.get_item_properties', autospec=True)
    def test_deployment_list_all_environments(self, mock_util):
        arglist = ['--all-environments']

        verifylist = [('id', None), ('all_environments', True)]