8000 tests: add unicode test for line_protocol.make_line. · savraj/influxdb-python-appengine@64d03be · GitHub
[go: up one dir, main page]

Skip to content

Commit 64d03be

Browse files
committed
tests: add unicode test for line_protocol.make_line.
I'm discovered problems, while try to write data, with tags in unicode.
1 parent c101386 commit 64d03be

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

influxdb/tests/test_line_protocol.py

Lines changed: 21 additions & 0 deletions
< 8000 td data-grid-cell-id="diff-05a11b1c894ddb9c47dc40e4489e8b29e71b868bf8a9eaa006361f66cd448e77-2-3-2" data-line-anchor="diff-05a11b1c894ddb9c47dc40e4489e8b29e71b868bf8a9eaa006361f66cd448e77R3" data-selected="false" role="gridcell" style="background-color:var(--bgColor-default);padding-right:24px" tabindex="-1" valign="top" class="focusable-grid-cell diff-text-cell right-side-diff-cell left-side">

Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
23
34
import sys
45
if sys.version_info < (2, 7):
@@ -55,3 +56,23 @@ def test_string_val_newline(self):
5556
line_protocol.make_lines(data),
5657
'm1 multi_line="line1\\nline1\\nline3"\n'
5758
)
59+
60+
def test_make_lines_unicode(self):
61+
data = {
62+
"tags": {
63+
"unicode_tag": "\'Привет!\'" # Hello! in Russian
64+
},
65+
"points": [
66+
{
67+
"measurement": "test",
68+
"fields": {
69+
"unicode_val": "Привет!", # Hello! in Russian
70+
}
71+
}
72+
]
73+
}
74+
75+
self.assertEqual(
76+
line_protocol.make_lines(data),
77+
'test,unicode_tag=\'Привет!\' unicode_val="Привет!"\n'
78+
)

0 commit comments

Comments
 (0)
0