#!/usr/bin/env python
from six import StringIO

from cliff.formatters import shell

import mock


def test_shell_formatter():
    sf = shell.ShellFormatter()
    c = ('a', 'b', 'c')
    d = ('A', 'B', 'C')
    expected = 'a="A"\nb="B"\n'
    output = StringIO()
    args = mock.Mock()
    args.variables = ['a', 'b']
    args.prefix = ''
    sf.emit_one(c, d, output, args)
    actual = output.getvalue()
    assert expected == actual

Add unit test for shell formatter
Add unit test for shell formatter

This is in prepration for changing the behavior to escape double quotes.

Change-Id: Ib82511d066d70a1603b80ba8680b005e00113483
Related-Bug: #1269908
