diff options
author | rexlee8776 <limingjiang@huawei.com> | 2017-07-05 02:50:06 +0000 |
---|---|---|
committer | rexlee8776 <limingjiang@huawei.com> | 2017-07-06 07:49:10 +0000 |
commit | 25a37b2048281c64719bd6ad67860f65f6c31546 (patch) | |
tree | 726e1ff64ea3470ab6b91db8fdbc386383f08903 /tests/unit/dispatcher | |
parent | 3369461d0e51b22aa96e5bfd0d80b3f0f7f82c67 (diff) |
move flatten dict key to common utils
So it can easily be used by other testcase to unify result
JIRA: YARDSTICK-702
Change-Id: Id4fde38a9a0c2a87a6c870bdb7b0c8f3a3b371ac
Signed-off-by: rexlee8776 <limingjiang@huawei.com>
Diffstat (limited to 'tests/unit/dispatcher')
-rw-r--r-- | tests/unit/dispatcher/test_influxdb.py | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/tests/unit/dispatcher/test_influxdb.py b/tests/unit/dispatcher/test_influxdb.py index a5d9b0754..7ebe8c90b 100644 --- a/tests/unit/dispatcher/test_influxdb.py +++ b/tests/unit/dispatcher/test_influxdb.py @@ -76,23 +76,6 @@ class InfluxdbDispatcherTestCase(unittest.TestCase): }, "runner_id": 8921 } - self.data3 = { - "benchmark": { - "data": { - "mpstat": { - "cpu0": { - "%sys": "0.00", - "%idle": "99.00" - }, - "loadavg": [ - "1.09", - "0.29" - ] - }, - "rtt": "1.03" - } - } - } self.yardstick_conf = {'dispatcher_influxdb': {}} @@ -113,18 +96,6 @@ class InfluxdbDispatcherTestCase(unittest.TestCase): } self.assertEqual(influxdb.flush_result_data(data), 0) - def test__dict_key_flatten(self): - line = 'mpstat.loadavg1=0.29,rtt=1.03,mpstat.loadavg0=1.09,' \ - 'mpstat.cpu0.%idle=99.00,mpstat.cpu0.%sys=0.00' - # need to sort for assert to work - line = ",".join(sorted(line.split(','))) - influxdb = InfluxdbDispatcher(self.yardstick_conf) - flattened_data = influxdb._dict_key_flatten( - self.data3['benchmark']['data']) - result = ",".join( - [k + "=" + v for k, v in sorted(flattened_data.items())]) - self.assertEqual(result, line) - def test__get_nano_timestamp(self): influxdb = InfluxdbDispatcher(self.yardstick_conf) results = {'timestamp': '1451461248.925574'} |