testbuilder/core/base/basetest.py
def run_middlewares(self, step_context, mode):
        """Runs middlware depending on mode

        Middlewares are always run in order of registration
        
        Arguments:
            step_context {StepContext} -- The current step context
            mode {int} -- The middleware run mode
        """

        if mode == MIDDLEWARE_MODE_BEFORE_STEP:
            for middleware in self.middlewares:
                middleware.before_step(step_context)
        elif mode == MIDDLEWARE_MODE_AFTER_STEP:
            for middleware in self.middlewares:
                middleware.after_step(step_context)
        elif mode == MIDDLEWARE_MODE_STEP_FAILURE:
            for middleware in self.middlewares:
                middleware.step_failure(step_context)
        elif mode == MIDDLEWARE_MODE_TEARDOWN_BEFORE_STEP:
            for middleware in self.middlewares:
                middleware.tear_down_before_step(step_context)
        elif mode == MIDDLEWARE_MODE_TEARDOWN_AFTER_STEP:
            for middleware in self.middlewares:
                middleware.tear_down_after_step(step_context)
Runs middlware depending on mode

        Middlewares are always run in order of registration
        
        Arguments:
            step_context {StepContext} -- The current step context
            mode {int} -- The middleware run mode
        
Runs middlware depending on mode
Middlewares are always run in order of registration

step_context {StepContext} -- The current step context
mode {int} -- The middleware run mode
Runs middlware depending on mode Middlewares are always run in order of registration step_context { StepContext } -- The current step context mode { int } -- The middleware run mode
def run_middlewares(self, step_context, mode):
        if mode == MIDDLEWARE_MODE_BEFORE_STEP:
            for middleware in self.middlewares:
                middleware.before_step(step_context)
        elif mode == MIDDLEWARE_MODE_AFTER_STEP:
            for middleware in self.middlewares:
                middleware.after_step(step_context)
        elif mode == MIDDLEWARE_MODE_STEP_FAILURE:
            for middleware in self.middlewares:
                middleware.step_failure(step_context)
        elif mode == MIDDLEWARE_MODE_TEARDOWN_BEFORE_STEP:
            for middleware in self.middlewares:
                middleware.tear_down_before_step(step_context)
        elif mode == MIDDLEWARE_MODE_TEARDOWN_AFTER_STEP:
            for middleware in self.middlewares:
                middleware.tear_down_after_step(step_context)
def run_middlewares ( self , step_context , mode ) : if mode == MIDDLEWARE_MODE_BEFORE_STEP : for middleware in self . middlewares : middleware . before_step ( step_context ) elif mode == MIDDLEWARE_MODE_AFTER_STEP : for middleware in self . middlewares : middleware . after_step ( step_context ) elif mode == MIDDLEWARE_MODE_STEP_FAILURE : for middleware in self . middlewares : middleware . step_failure ( step_context ) elif mode == MIDDLEWARE_MODE_TEARDOWN_BEFORE_STEP : for middleware in self . middlewares : middleware . tear_down_before_step ( step_context ) elif mode == MIDDLEWARE_MODE_TEARDOWN_AFTER_STEP : for middleware in self . middlewares : middleware . tear_down_after_step ( step_context )
Runs middlware depending on mode
Middlewares are always run in order of registration
Runs middlware depending on mode Middlewares are always run in order of registration
"""Runs middlware depending on mode

        Middlewares are always run in order of registration
        
        Arguments:
            step_context {StepContext} -- The current step context
            mode {int} -- The middleware run mode
        """
self
step_context
mode