class Feature(base.TestCase):
- """Parent class of Functest Feature."""
+ """Base model for single Functest feature."""
def __init__(self, **kwargs):
super(Feature, self).__init__(**kwargs)
self.logger = ft_logger.Logger(self.project_name).getLogger()
def execute(self, **kwargs):
- """Execute Feature.
+ """Execute the Python method.
The subclasses must override the default implementation which
- is false on purpose. The only prerequisite is to return 0 if
- success or anything else if failure.
+ is false on purpose.
+
+ The new implementation must return 0 if success or anything
+ else if failure.
Args:
kwargs: Arbitrary keyword arguments.
return -1
def run(self, **kwargs):
- """Run Feature.
+ """Run the feature.
It allows executing any Python method by calling execute().
class TestCase(object):
- """Parent class of Functest TestCase."""
+ """Base model for single Functest testcase."""
EX_OK = os.EX_OK
- """Status code returned when everything is OK"""
+ """everything is OK"""
EX_RUN_ERROR = os.EX_SOFTWARE
- """Status code returned when run() fails"""
+ """run() failed"""
EX_PUSH_TO_DB_ERROR = os.EX_SOFTWARE - 1
- """Status code returned when push_to_db() fails"""
+ """push_to_db() failed"""
EX_TESTCASE_FAILED = os.EX_SOFTWARE - 2
- """Status code returned when results are false"""
+ """results are false"""
logger = ft_logger.Logger(__name__).getLogger()
self.stop_time = ""
def check_criteria(self):
- """Interpret the results of TestCase.
+ """Interpret the results of the testcase.
It allows getting the results of TestCase. It completes run()
which only returns the execution status.
return TestCase.EX_TESTCASE_FAILED
def run(self, **kwargs):
- """Run TestCase.
+ """Run the testcase.
It allows running TestCase and getting its execution
status.
The subclasses must override the default implementation which
- is false on purpose. The only prerequisite is to set the
- following attributes to push the results to DB:
+ is false on purpose.
+
+ The new implementation must set the following attributes to
+ push the results to DB:
- * case_name,
* criteria,
* start_time,
* stop_time.
return TestCase.EX_RUN_ERROR
def push_to_db(self):
- """Push the results of TestCase to the DB.
+ """Push the results of the testcase to the DB.
It allows publishing the results and to check the status.