# Path: cliff/formatters/yaml_format.py
# class YAMLFormatter(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):


from io import StringIO
from unittest import mock
from cliff.formatters import yaml_format
from cliff.tests import base
from cliff.tests import test_columns
import yaml
#  License for the specific language governing permissions and limitations
#  under the License.





class TestYAMLFormatter(base.TestBase):

    def test_format_one(self):
        sf = yaml_format.YAMLFormatter()
        c = ('a', 'b', 'c', 'd')
        d = ('A', 'B', 'C', '"escape me"')
        expected = {
            'a': 'A',
            'b': 'B',
            'c': 'C',
            'd': '"escape me"'
        }
        output = StringIO()
        args = mock.Mock()
        sf.emit_one(c, d, output, args)
        actual = yaml.safe_load(output.getvalue())
        self.assertEqual(expected, actual)

    def test_formattablecolumn_one(self):
        sf = yaml_format.YAMLFormatter()
        c = ('a', 'b', 'c', 'd')
        d = ('A', 'B', 'C', test_columns.FauxColumn(['the', 'value']))
        expected = {

# Path: cliff/formatters/yaml_format.py
# class YAMLFormatter(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_yaml.py
from io import StringIO
from unittest import mock
from cliff.formatters import yaml_format
from cliff.tests import base
from cliff.tests import test_columns
import yaml

#  License for the specific language governing permissions and limitations
#  under the License.





class TestYAMLFormatter(base.TestBase):

    def test_format_one(self):
        sf = yaml_format.YAMLFormatter()
        c = ('a', 'b', 'c', 'd')
        d = ('A', 'B', 'C', '"escape me"')
        expected = {
            'a': 'A',
            'b': 'B',
            'c': 'C',
            'd': '"escape me"'
        }
        output = StringIO()
        args = mock.Mock()
        sf.emit_one(c, d, output, args)
        actual = yaml.safe_load(output.getvalue())
        self.assertEqual(expected, actual)

    def test_formattablecolumn_one(self):
        sf = yaml_format.YAMLFormatter()
        c = ('a', 'b', 'c', 'd')
        d = ('A', 'B', 'C', test_columns.FauxColumn(['the', 'value']))
        expected = {

            'a': 'A',