aboutsummaryrefslogtreecommitdiffstats
path: root/xtesting
diff options
context:
space:
mode:
Diffstat (limited to 'xtesting')
-rw-r--r--xtesting/ci/tier_handler.py18
-rw-r--r--xtesting/core/testcase.py9
-rw-r--r--xtesting/tests/unit/ci/test_tier_handler.py5
-rw-r--r--xtesting/utils/constants.py2
4 files changed, 6 insertions, 28 deletions
diff --git a/xtesting/ci/tier_handler.py b/xtesting/ci/tier_handler.py
index 6f78f202..86f1374f 100644
--- a/xtesting/ci/tier_handler.py
+++ b/xtesting/ci/tier_handler.py
@@ -16,24 +16,6 @@ import textwrap
import prettytable
-LINE_LENGTH = 72
-
-
-def split_text(text, max_len):
- words = text.split()
- lines = []
- line = ""
- for word in words:
- if len(line) + len(word) < max_len - 1:
- line += word + " "
- else:
- lines.append(line)
- line = word + " "
- if line != "":
- lines.append(line)
- return lines
-
-
class Tier():
def __init__(self, name, description=""):
diff --git a/xtesting/core/testcase.py b/xtesting/core/testcase.py
index 8faf3f43..08ce426b 100644
--- a/xtesting/core/testcase.py
+++ b/xtesting/core/testcase.py
@@ -28,6 +28,7 @@ from six.moves import urllib
from xtesting.utils import decorators
from xtesting.utils import env
+from xtesting.utils import constants
__author__ = "Cedric Ollivier <cedric.ollivier@orange.com>"
@@ -55,7 +56,7 @@ class TestCase():
EX_PUBLISH_ARTIFACTS_ERROR = os.EX_SOFTWARE - 4
"""publish_artifacts() failed"""
- dir_results = "/var/lib/xtesting/results"
+ dir_results = constants.RESULTS_DIR
_job_name_rule = "(dai|week)ly-(.+?)-[0-9]*"
headers = {'Content-Type': 'application/json'}
__logger = logging.getLogger(__name__)
@@ -69,9 +70,9 @@ class TestCase():
self.start_time = 0
self.stop_time = 0
self.is_skipped = False
- self.output_log_name = 'xtesting.log'
- self.output_debug_log_name = 'xtesting.debug.log'
- self.res_dir = "{}/{}".format(self.dir_results, self.case_name)
+ self.output_log_name = os.path.basename(constants.LOG_PATH)
+ self.output_debug_log_name = os.path.basename(constants.DEBUG_LOG_PATH)
+ self.res_dir = os.path.join(self.dir_results, self.case_name)
def __str__(self):
try:
diff --git a/xtesting/tests/unit/ci/test_tier_handler.py b/xtesting/tests/unit/ci/test_tier_handler.py
index 5ee62c4f..668f33cc 100644
--- a/xtesting/tests/unit/ci/test_tier_handler.py
+++ b/xtesting/tests/unit/ci/test_tier_handler.py
@@ -29,11 +29,6 @@ class TierHandlerTesting(unittest.TestCase):
self.testcase.str = self.testcase.__str__()
self.tier.str = self.tier.__str__()
- def test_split_text(self):
- test_str = 'this is for testing'
- self.assertEqual(tier_handler.split_text(test_str, 10),
- ['this is ', 'for ', 'testing '])
-
def test_add_test(self):
self.tier.add_test(self.test)
self.assertEqual(self.tier.tests_array, [self.test])
diff --git a/xtesting/utils/constants.py b/xtesting/utils/constants.py
index 7677f2e5..acd0d31d 100644
--- a/xtesting/utils/constants.py
+++ b/xtesting/utils/constants.py
@@ -6,7 +6,7 @@ import os
ENV_FILE = '/var/lib/xtesting/conf/env_file'
-RESULTS_DIR = '/var/lib/xtesting/results/'
+RESULTS_DIR = '/var/lib/xtesting/results'
LOG_PATH = os.path.join(RESULTS_DIR, 'xtesting.log')
DEBUG_LOG_PATH = os.path.join(RESULTS_DIR, 'xtesting.debug.log')