# 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
        sf.emit_one(c, d, output, args)
        value = output.getvalue()
        print(len(value.splitlines()))
        self.assertEqual(1, len(value.splitlines()))
        actual = json.loads(value)
        self.assertEqual(expected, actual)

        args.noindent = False
        output = io.StringIO()
        sf.emit_one(c, d, output, args)
        value = output.getvalue()
        self.assertEqual(6, len(value.splitlines()))
        actual = json.loads(value)
        self.assertEqual(expected, actual)

    def test_formattablecolumn_one(self):
        sf = json_format.JSONFormatter()
        c = ('a', 'b', 'c', 'd')
        d = ('A', 'B', 'C', test_columns.FauxColumn(['the', 'value']))
        expected = {
            'a': 'A',
            'b': 'B',
            'c': 'C',
            'd': ['the', 'value'],
        }
        args = mock.Mock()
        sf.add_argument_group(args)

        args.noindent = True
        output = io.StringIO()

# 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

        sf.emit_one(c, d, output, args)
        value = output.getvalue()
        print(len(value.splitlines()))
        self.assertEqual(1, len(value.splitlines()))
        actual = json.loads(value)
        self.assertEqual(expected, actual)

        args.noindent = False
        output = io.StringIO()
        sf.emit_one(c, d, output, args)
        value = output.getvalue()
        self.assertEqual(6, len(value.splitlines()))
        actual = json.loads(value)
        self.assertEqual(expected, actual)

    def test_formattablecolumn_one(self):
        sf = json_format.JSONFormatter()
        c = ('a', 'b', 'c', 'd')
        d = ('A', 'B', 'C', test_columns.FauxColumn(['the', 'value']))
        expected = {
            'a': 'A',
            'b': 'B',
            'c': 'C',
            'd': ['the', 'value'],
        }
        args = mock.Mock()
        sf.add_argument_group(args)

        args.noindent = True
        output = io.StringIO()

        sf.emit_one(c, d, output, args)