aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Williams <neil.williams@linaro.org>2018-07-16 11:31:26 +0100
committerRemi Duraffort <remi.duraffort@linaro.org>2018-07-16 12:45:32 +0000
commitf037069b3ffb30d12ec5d10721826499fc4eb949 (patch)
tree82c3d18fc63818172aa5d11430b1928cc387eeb3
parent425fcaefce398fb5295083b1af41bec41a0916fd (diff)
Make handle_testcase local
Function only used in one file, move to that file and drop the import. Change-Id: Ib91038c972f0cb07f60a3a6f6c7c70ec417b5ef3
-rw-r--r--lava_dispatcher/actions/test/__init__.py21
-rw-r--r--lava_dispatcher/actions/test/shell.py19
2 files changed, 16 insertions, 24 deletions
diff --git a/lava_dispatcher/actions/test/__init__.py b/lava_dispatcher/actions/test/__init__.py
index da14241d2..63370a23b 100644
--- a/lava_dispatcher/actions/test/__init__.py
+++ b/lava_dispatcher/actions/test/__init__.py
@@ -18,32 +18,13 @@
# along
# with this program; if not, see <http://www.gnu.org/licenses>.
-from lava_dispatcher.action import (
- Action,
- JobError,
-)
+from lava_dispatcher.action import Action
from lava_dispatcher.logical import (
LavaTest,
RetryAction,
)
-def handle_testcase(params):
-
- # FIXME: move to utils
- data = {}
- for param in params:
- parts = param.split('=')
- if len(parts) == 2:
- key, value = parts
- key = key.lower()
- data[key] = value
- else:
- raise JobError(
- "Ignoring malformed parameter for signal: \"%s\". " % param)
- return data
-
-
class TestAction(Action):
"""
Base class for all actions which run lava test
diff --git a/lava_dispatcher/actions/test/shell.py b/lava_dispatcher/actions/test/shell.py
index 4ecc74392..6090f3330 100644
--- a/lava_dispatcher/actions/test/shell.py
+++ b/lava_dispatcher/actions/test/shell.py
@@ -33,10 +33,7 @@ from lava_common.exceptions import (
TestError,
LAVABug,
)
-from lava_dispatcher.actions.test import (
- TestAction,
- handle_testcase
-)
+from lava_dispatcher.actions.test import TestAction
from lava_dispatcher.action import Pipeline
from lava_dispatcher.logical import (
LavaTest,
@@ -52,6 +49,20 @@ from lava_common.constants import (
# pylint: disable=too-many-branches,too-many-statements,too-many-instance-attributes,logging-not-lazy
+def handle_testcase(params):
+ data = {}
+ for param in params:
+ parts = param.split('=')
+ if len(parts) == 2:
+ key, value = parts
+ key = key.lower()
+ data[key] = value
+ else:
+ raise JobError(
+ "Ignoring malformed parameter for signal: \"%s\". " % param)
+ return data
+
+
class TestShell(LavaTest):
"""
LavaTestShell Strategy object