1 ##############################################################################
2 # Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 # Unittest for yardstick.dispatcher.influxdb_line_protocol
11 # yardstick comment: this file is a modified copy of
12 # influxdb-python/influxdb/tests/test_line_protocol.py
14 from __future__ import absolute_import
16 from third_party.influxdb.influxdb_line_protocol import make_lines
19 class TestLineProtocol(unittest.TestCase):
21 def test_make_lines(self):
31 "measurement": "test",
33 "string_val": "hello!",
45 'test,integer_tag=2,string_tag=hello '
46 'bool_val=True,float_val=1.1,int_val=1i,string_val="hello!"\n'
49 def test_string_val_newline(self):
55 "multi_line": "line1\nline1\nline3"
63 'm1 multi_line="line1\\nline1\\nline3"\n'