Commit 8947a112 authored by Rafael Monnerat's avatar Rafael Monnerat

erp5.util: Move dealShebang into Utils

  In this way we don't have to duplicate the method everywhere.
parent 2c789110
......@@ -41,6 +41,7 @@ from ProcessManager import SubprocessError, ProcessManager, CancellationError
from subprocess import CalledProcessError
from NodeTestSuite import SlapOSInstance
from Updater import Updater
from Utils import dealShebang
from erp5.util import taskdistribution
class UnitTestRunner():
......@@ -130,7 +131,7 @@ class UnitTestRunner():
run_test_suite_path = run_test_suite_path_list[0]
run_test_suite_revision = node_test_suite.revision
# Deal with Shebang size limitation
invocation_list = self.testnode._dealShebang(run_test_suite_path)
invocation_list = dealShebang(run_test_suite_path)
invocation_list.extend([run_test_suite_path,
'--test_suite', node_test_suite.test_suite,
'--revision', node_test_suite.revision,
......
......@@ -20,3 +20,10 @@ def deunicodeData(data):
else:
new_data = data
return new_data
def dealShebang(run_test_suite_path):
line = open(run_test_suite_path, 'r').readline()
invocation_list = []
if line[:2] == '#!':
invocation_list = line[2:].split()
return invocation_list
......@@ -111,13 +111,6 @@ class TestNode(object):
if self.node_test_suite_dict.has_key(reference):
self.node_test_suite_dict.pop(reference)
def _dealShebang(self,run_test_suite_path):
line = open(run_test_suite_path, 'r').readline()
invocation_list = []
if line[:2] == '#!':
invocation_list = line[2:].split()
return invocation_list
def constructProfile(self, node_test_suite, test_type, use_relative_path=False):
config = self.config
profile_content = ''
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment