Tidy up logging and rework tests from scratch

This commit is contained in:
Javanaut
2026-04-09 12:46:24 +02:00
parent f9c8b8ac5e
commit 60ae58500a
84 changed files with 1283 additions and 187 deletions

View File

@@ -0,0 +1,37 @@
import os, sys, importlib, glob, inspect, itertools
class LabelCombinator():
IDENTIFIER = 'label'
PREFIX = 'label_combinator_'
LABEL = 'ffx'
def __init__(self, context = None):
self._context = context
self._logger = context['logger']
self._reportLogger = context['report_logger']
def getIdentifier(self):
return LabelCombinator.IDENTIFIER
@staticmethod
def list():
basePath = os.path.dirname(__file__)
return [os.path.basename(p)[len(LabelCombinator.PREFIX):-3]
for p
in glob.glob(f"{ basePath }/{LabelCombinator.PREFIX}*.py", recursive = True)
if p != __file__]
@staticmethod
def getClassReference(identifier):
module_name = f"tests.legacy.{LabelCombinator.PREFIX}{ identifier }"
importlib.import_module(module_name)
for name, obj in inspect.getmembers(sys.modules[module_name]):
#HINT: Excluding MediaCombinator as it seems to be included by import (?)
if inspect.isclass(obj) and name != 'LabelCombinator' and name.startswith('LabelCombinator'):
return obj
@staticmethod
def getAllClassReferences():
return [LabelCombinator.getClassReference(i) for i in LabelCombinator.list()]