Tidy up logging and rework tests from scratch
This commit is contained in:
36
tests/legacy/disposition_combinator_2.py
Normal file
36
tests/legacy/disposition_combinator_2.py
Normal file
@@ -0,0 +1,36 @@
|
||||
import os, sys, importlib, glob, inspect, itertools
|
||||
|
||||
class DispositionCombinator2():
|
||||
|
||||
IDENTIFIER = 'disposition2'
|
||||
|
||||
def __init__(self, context = None):
|
||||
self._context = context
|
||||
self._logger = context['logger']
|
||||
self._reportLogger = context['report_logger']
|
||||
|
||||
def getIdentifier(self):
|
||||
return DispositionCombinator2.IDENTIFIER
|
||||
def getVariant(self):
|
||||
return self._variant
|
||||
|
||||
@staticmethod
|
||||
def list():
|
||||
basePath = os.path.dirname(__file__)
|
||||
return [os.path.basename(p)[25:-3]
|
||||
for p
|
||||
in glob.glob(f"{ basePath }/disposition_combinator_2_*.py", recursive = True)
|
||||
if p != __file__]
|
||||
|
||||
@staticmethod
|
||||
def getClassReference(identifier):
|
||||
module_name = f"tests.legacy.disposition_combinator_2_{ identifier }"
|
||||
importlib.import_module(module_name)
|
||||
for name, obj in inspect.getmembers(sys.modules[module_name]):
|
||||
#HINT: Excluding DispositionCombination as it seems to be included by import (?)
|
||||
if inspect.isclass(obj) and name != 'DispositionCombinator2' and name.startswith('DispositionCombinator2'):
|
||||
return obj
|
||||
|
||||
@staticmethod
|
||||
def getAllClassReferences():
|
||||
return [DispositionCombinator2.getClassReference(i) for i in DispositionCombinator2.list()]
|
||||
Reference in New Issue
Block a user