# Path: cliff/formatters/json_format.py
# class JSONFormatter(base.ListFormatter, base.SingleFormatter):
#     def add_argument_group(self, parser):
#     def emit_list(self, column_names, data, stdout, parsed_args):
#     def emit_one(self, column_names, data, stdout, parsed_args):
# 
# Path: cliff/tests/test_columns.py
# class FauxColumn(columns.FormattableColumn):
# class TestColumns(unittest.TestCase):
#     def human_readable(self):
#     def test_faux_column_machine(self):
#     def test_faux_column_human(self):
#     def test_sorting(self):


import io
import json
from unittest import mock
from cliff.formatters import json_format
from cliff.tests import base
from cliff.tests import test_columns
        self.assertEqual(expected, actual)

    def test_list(self):
        sf = json_format.JSONFormatter()
        c = ('a', 'b', 'c')
        d = (
            ('A1', 'B1', 'C1'),
            ('A2', 'B2', 'C2'),
            ('A3', 'B3', 'C3')
        )
        expected = [
            {'a': 'A1', 'b': 'B1', 'c': 'C1'},
            {'a': 'A2', 'b': 'B2', 'c': 'C2'},
            {'a': 'A3', 'b': 'B3', 'c': 'C3'}
        ]
        args = mock.Mock()
        sf.add_argument_group(args)

        args.noindent = True
        output = io.StringIO()
        sf.emit_list(c, d, output, args)
        value = output.getvalue()
        self.assertEqual(1, len(value.splitlines()))
        actual = json.loads(value)
        self.assertEqual(expected, actual)

        args.noindent = False
        output = io.StringIO()
        sf.emit_list(c, d, output, args)
        value = output.getvalue()

# Path: cliff/formatters/json_format.py
# class JSONFormatter(base.ListFormatter, base.SingleFormatter):
#     def add_argument_group(self, parser):
#     def emit_list(self, column_names, data, stdout, parsed_args):
#     def emit_one(self, column_names, data, stdout, parsed_args):
# 
# Path: cliff/tests/test_columns.py
# class FauxColumn(columns.FormattableColumn):
# class TestColumns(unittest.TestCase):
#     def human_readable(self):
#     def test_faux_column_machine(self):
#     def test_faux_column_human(self):
#     def test_sorting(self):


# Path: cliff/tests/test_formatters_json.py
import io
import json
from unittest import mock
from cliff.formatters import json_format
from cliff.tests import base
from cliff.tests import test_columns

        self.assertEqual(expected, actual)

    def test_list(self):
        sf = json_format.JSONFormatter()
        c = ('a', 'b', 'c')
        d = (
            ('A1', 'B1', 'C1'),
            ('A2', 'B2', 'C2'),
            ('A3', 'B3', 'C3')
        )
        expected = [
            {'a': 'A1', 'b': 'B1', 'c': 'C1'},
            {'a': 'A2', 'b': 'B2', 'c': 'C2'},
            {'a': 'A3', 'b': 'B3', 'c': 'C3'}
        ]
        args = mock.Mock()
        sf.add_argument_group(args)

        args.noindent = True
        output = io.StringIO()
        sf.emit_list(c, d, output, args)
        value = output.getvalue()
        self.assertEqual(1, len(value.splitlines()))
        actual = json.loads(value)
        self.assertEqual(expected, actual)

        args.noindent = False
        output = io.StringIO()
        sf.emit_list(c, d, output, args)
        value = output.getvalue()

        self.assertEqual(17, len(value.splitlines()))