From 9b36d7fcfdbe45cd90723a6153863e4789d650cf Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Thu, 20 Apr 2017 14:52:47 +0200 Subject: Minor changes in docstrings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It removes case_name from the list of attributes that run() must set because it's now managed by run_tests.py (see __init__()) Change-Id: Id6228880257d0e9fb27483c56aa9985197feb04e Signed-off-by: Cédric Ollivier --- functest/core/feature.py | 12 +++++++----- functest/core/testcase.py | 23 ++++++++++++----------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/functest/core/feature.py b/functest/core/feature.py index 00c7ec74..d8ddbdeb 100644 --- a/functest/core/feature.py +++ b/functest/core/feature.py @@ -25,7 +25,7 @@ __author__ = ("Serena Feng , " class Feature(base.TestCase): - """Parent class of Functest Feature.""" + """Base model for single Functest feature.""" def __init__(self, **kwargs): super(Feature, self).__init__(**kwargs) @@ -34,11 +34,13 @@ class Feature(base.TestCase): 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. @@ -50,7 +52,7 @@ class Feature(base.TestCase): return -1 def run(self, **kwargs): - """Run Feature. + """Run the feature. It allows executing any Python method by calling execute(). diff --git a/functest/core/testcase.py b/functest/core/testcase.py index 472d847a..c306b143 100644 --- a/functest/core/testcase.py +++ b/functest/core/testcase.py @@ -18,19 +18,19 @@ __author__ = "Cedric Ollivier " 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() @@ -43,7 +43,7 @@ class TestCase(object): 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. @@ -63,16 +63,17 @@ class TestCase(object): 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. @@ -88,7 +89,7 @@ class TestCase(object): 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. -- cgit 1.2.3-korg