# Path: heatclient/common/format_utils.py
# class RawFormat(command.ShowOne):
# class JsonFormat(RawFormat):
# class YamlFormat(RawFormat):
# class ShellFormat(RawFormat):
# class ValueFormat(RawFormat):
#     def produce_output(self, parsed_args, column_names, data):
#     def formatter_default(self):
#     def formatter_default(self):
#     def formatter_default(self):
#     def formatter_default(self):
# def indent_and_truncate(txt, spaces=0, truncate=False, truncate_limit=10,
#                         truncate_prefix=None, truncate_postfix=None):
# def print_software_deployment_output(data, name, out=sys.stdout, long=False):
# 
# Path: heatclient/tests/unit/osc/utils.py
# class TestCase(testtools.TestCase):
# class TestCommand(TestCase):
#     def setUp(self):
#     def assertNotCalled(self, m, msg=None):
#         def assertIsInstance(self, obj, cls, msg=None):
#     def setUp(self):
#     def check_parser(self, cmd, args, verify_args):


import json
import six
import yaml
from heatclient.common import format_utils
from heatclient.tests.unit.osc import utils

class ShowValue(format_utils.ValueFormat):
    def take_action(self, parsed_args):
        return columns, data


class TestFormats(utils.TestCommand):

    def test_json_format(self):
        self.cmd = ShowJson(self.app, None)
        parsed_args = self.check_parser(self.cmd, [], [])
        expected = json.dumps(dict(zip(columns, data)), indent=2)

        self.cmd.run(parsed_args)

        self.assertEqual(expected, self.app.stdout.make_string().rstrip())

    def test_yaml_format(self):
        self.cmd = ShowYaml(self.app, None)
        parsed_args = self.check_parser(self.cmd, [], [])
        expected = yaml.safe_dump(dict(zip(columns, data)),
                                  default_flow_style=False)

        self.cmd.run(parsed_args)

        self.assertEqual(expected, self.app.stdout.make_string())

    def test_shell_format(self):
        self.cmd = ShowShell(self.app, None)
        parsed_args = self.check_parser(self.cmd, [], [])

# Path: heatclient/common/format_utils.py
# class RawFormat(command.ShowOne):
# class JsonFormat(RawFormat):
# class YamlFormat(RawFormat):
# class ShellFormat(RawFormat):
# class ValueFormat(RawFormat):
#     def produce_output(self, parsed_args, column_names, data):
#     def formatter_default(self):
#     def formatter_default(self):
#     def formatter_default(self):
#     def formatter_default(self):
# def indent_and_truncate(txt, spaces=0, truncate=False, truncate_limit=10,
#                         truncate_prefix=None, truncate_postfix=None):
# def print_software_deployment_output(data, name, out=sys.stdout, long=False):
# 
# Path: heatclient/tests/unit/osc/utils.py
# class TestCase(testtools.TestCase):
# class TestCommand(TestCase):
#     def setUp(self):
#     def assertNotCalled(self, m, msg=None):
#         def assertIsInstance(self, obj, cls, msg=None):
#     def setUp(self):
#     def check_parser(self, cmd, args, verify_args):


# Path: heatclient/tests/unit/test_format_utils.py
import json
import six
import yaml
from heatclient.common import format_utils
from heatclient.tests.unit.osc import utils


class ShowValue(format_utils.ValueFormat):
    def take_action(self, parsed_args):
        return columns, data


class TestFormats(utils.TestCommand):

    def test_json_format(self):
        self.cmd = ShowJson(self.app, None)
        parsed_args = self.check_parser(self.cmd, [], [])
        expected = json.dumps(dict(zip(columns, data)), indent=2)

        self.cmd.run(parsed_args)

        self.assertEqual(expected, self.app.stdout.make_string().rstrip())

    def test_yaml_format(self):
        self.cmd = ShowYaml(self.app, None)
        parsed_args = self.check_parser(self.cmd, [], [])
        expected = yaml.safe_dump(dict(zip(columns, data)),
                                  default_flow_style=False)

        self.cmd.run(parsed_args)

        self.assertEqual(expected, self.app.stdout.make_string())

    def test_shell_format(self):
        self.cmd = ShowShell(self.app, None)
        parsed_args = self.check_parser(self.cmd, [], [])

        expected = '''\