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
15 from third_party.influxdb.influxdb_line_protocol import make_lines
18 class TestLineProtocol(unittest.TestCase):
20 def test_make_lines(self):
30 "measurement": "test",
32 "string_val": "hello!",
44 'test,integer_tag=2,string_tag=hello '
45 'bool_val=True,float_val=1.1,int_val=1i,string_val="hello!"\n'
48 def test_string_val_newline(self):
54 "multi_line": "line1\nline1\nline3"
62 'm1 multi_line="line1\\nline1\\nline3"\n'