diff --git a/bin/ffx/test/disposition.py b/bin/ffx/test/disposition.py new file mode 100644 index 0000000..f528d59 --- /dev/null +++ b/bin/ffx/test/disposition.py @@ -0,0 +1,24 @@ +import os, sys, importlib, glob, inspect + +class Disposition(): + + def __init__(self, context = None): + self._context = context + self._logger = context['logger'] + self._reportLogger = context['report_logger'] + + @staticmethod + def list(): + basePath = os.path.dirname(__file__) + return [os.path.basename(p)[9:-3] + for p + in glob.glob(f"{ basePath }/disposition_*.py", recursive = True) + if p != __file__] + + @staticmethod + def getClassReference(identifier): + importlib.import_module(f"ffx.test.disposition_{ identifier }") + for name, obj in inspect.getmembers(sys.modules[f"ffx.test.disposition_{ identifier }"]): + #HINT: Excluding Disposition as it seems to be included by import (?) + if inspect.isclass(obj) and name != 'Disposition' and name.startswith('Disposition'): + return obj diff --git a/bin/ffx/test/scenario_1.py b/bin/ffx/test/scenario_1.py index 9475a1d..ed9df43 100644 --- a/bin/ffx/test/scenario_1.py +++ b/bin/ffx/test/scenario_1.py @@ -98,5 +98,4 @@ class Scenario1(Scenario): except AssertionError as ae: - # click.echo(f"Scenario 1 test failed ({ae})") self._reportLogger.error(f"Scenario 1 test failed ({ae})")