Skip to content

Commit 7d3772b

Browse files
author
Kevin McDonald
committed
Merge branch 'master' of github.com:softlayer/softlayer-python
2 parents 5012de4 + 3ad50d7 commit 7d3772b

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

SoftLayer/CLI/formatting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def format_output(data, fmt='table'): # pylint: disable=R0911,R0912
5050
# responds to .formatted
5151
if hasattr(data, 'formatted'):
5252
if fmt == 'table':
53-
return str(data.formatted)
53+
return data.formatted
5454

5555
# responds to .separator
5656
if hasattr(data, 'separator'):

SoftLayer/tests/CLI/helper_tests.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# -*- coding: utf-8 -*-
12
"""
23
SoftLayer.tests.CLI.helper_tests
34
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -357,6 +358,17 @@ def test_format_output_python_keyvaluetable(self):
357358
ret = formatting.format_output(t, 'python')
358359
self.assertEqual({'nothing': None}, ret)
359360

361+
def test_format_output_unicode(self):
362+
t = formatting.format_output('☃', 'raw')
363+
self.assertEqual('☃', t)
364+
365+
item = formatting.FormattedItem('raw ☃', '☃')
366+
t = formatting.format_output(item)
367+
self.assertEqual('☃', t)
368+
369+
t = formatting.format_output(item, 'raw')
370+
self.assertEqual('raw ☃', t)
371+
360372

361373
class TestTemplateArgs(testing.TestCase):
362374

0 commit comments

Comments
 (0)