aboutsummaryrefslogtreecommitdiffstats
path: root/functest/api/resources
diff options
context:
space:
mode:
authorLinda Wang <wangwulin@huawei.com>2017-09-20 10:08:09 +0000
committerLinda Wang <wangwulin@huawei.com>2017-09-20 10:08:09 +0000
commite4ad79cabc3292a1cb0d8642f0c9eddbbc2befd1 (patch)
treeeac86a586d12dc332f7640e0945f4d01cb992f0d /functest/api/resources
parent3a9d9689ab719a99d1e1c79bc52c4c8fa7521aa4 (diff)
Remove white space when listing testcases
Change-Id: I2f3c7a9301a6b2dcb03a90175be23223f6a6229a Signed-off-by: Linda Wang <wangwulin@huawei.com>
Diffstat (limited to 'functest/api/resources')
-rw-r--r--functest/api/resources/v1/testcases.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/functest/api/resources/v1/testcases.py b/functest/api/resources/v1/testcases.py
index b6733137..7cc70bbc 100644
--- a/functest/api/resources/v1/testcases.py
+++ b/functest/api/resources/v1/testcases.py
@@ -13,6 +13,7 @@ Resources to handle testcase related requests
import logging
import os
+import re
import pkg_resources
import socket
import uuid
@@ -43,7 +44,7 @@ class V1Testcases(ApiResource):
def get(self): # pylint: disable=no-self-use
""" GET all testcases """
testcases_list = Testcase().list()
- result = {'testcases': testcases_list.split('\n')[:-1]}
+ result = {'testcases': re.split(' |\n ', testcases_list)[1:]}
return jsonify(result)