From: Linda Wang Date: Wed, 20 Sep 2017 10:08:09 +0000 (+0000) Subject: Remove white space when listing testcases X-Git-Tag: opnfv-5.0.RC1~52^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F55%2F42555%2F1;p=functest.git Remove white space when listing testcases Change-Id: I2f3c7a9301a6b2dcb03a90175be23223f6a6229a Signed-off-by: Linda Wang (cherry picked from commit e4ad79cabc3292a1cb0d8642f0c9eddbbc2befd1) --- diff --git a/functest/api/resources/v1/testcases.py b/functest/api/resources/v1/testcases.py index b67331377..7cc70bbc9 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)