Skip to content

Commit

Permalink
Fix #4
Browse files Browse the repository at this point in the history
  • Loading branch information
octplane committed Feb 2, 2017
1 parent 1fd55f4 commit 9c3163d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
10 changes: 8 additions & 2 deletions callbacks/anstomlog.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# coding=utf-8
# pylint: disable=I0011,E0401,C0103,C0111,W0212

from __future__ import (absolute_import, division, print_function)
Expand Down Expand Up @@ -66,11 +67,11 @@ def deep_serialize(data, indent=0):

output = output + padding + "}"
else:
string_form = str(data)
string_form = "%s" % data
if len(string_form) == 0:
return "\"\""
else:
return str(data)
return string_form
return output

class TestStringMethods(unittest.TestCase):
Expand All @@ -96,6 +97,11 @@ def test_single_empty_item_array(self):
deep_serialize([""]),
"[ \"\" ]")

def test_issue_4(self):
self.assertEqual(
deep_serialize(["ÉLÉGANT"]),
"[ ÉLÉGANT ]")


def test_empty_array(self):
self.assertEqual(
Expand Down
8 changes: 8 additions & 0 deletions test-4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- name: "Test case for issue unicode"
hosts: first
tasks:
- debug:
msg: "Ansible est ÉLÉGANT!"
- name: "Error when using -v"
command: echo -e "\xe2\x98\xba\x0a"

0 comments on commit 9c3163d

Please sign in to comment.