summaryrefslogtreecommitdiff
path: root/cliff/tests/test_formatters_shell.py
diff options
context:
space:
mode:
authorClint Byrum <clint@fewbar.com>2014-01-16 12:10:55 -0800
committerClint Byrum <clint@fewbar.com>2014-02-03 13:45:38 -0800
commit97c14e034fa79dfe55d12841878b77c644e28bfe (patch)
tree5b46a7fd7b694228944bf931bcf3d1ddc4abd4bf /cliff/tests/test_formatters_shell.py
parente447666860730039eb1a3fa040f79d6b8a852fd5 (diff)
downloadcliff-97c14e034fa79dfe55d12841878b77c644e28bfe.tar.gz
Escape double quotes in shell formatter
Before this change the shell formatter could not be trusted to output anything with double quotes. With this change we can pass the output directly to the shell for evaluation. Change-Id: I8f2bf23a1523f6f02e5ce8563038b20e079b52da Closes-Bug: #1269908
Diffstat (limited to 'cliff/tests/test_formatters_shell.py')
-rw-r--r--cliff/tests/test_formatters_shell.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/cliff/tests/test_formatters_shell.py b/cliff/tests/test_formatters_shell.py
index 5d49e65..93452ba 100644
--- a/cliff/tests/test_formatters_shell.py
+++ b/cliff/tests/test_formatters_shell.py
@@ -8,12 +8,12 @@ import mock
def test_shell_formatter():
sf = shell.ShellFormatter()
- c = ('a', 'b', 'c')
- d = ('A', 'B', 'C')
- expected = 'a="A"\nb="B"\n'
+ c = ('a', 'b', 'c', 'd')
+ d = ('A', 'B', 'C', '"escape me"')
+ expected = 'a="A"\nb="B"\nd="\\"escape me\\""\n'
output = StringIO()
args = mock.Mock()
- args.variables = ['a', 'b']
+ args.variables = ['a', 'b', 'd']
args.prefix = ''
sf.emit_one(c, d, output, args)
actual = output.getvalue()