Create attractive VASL scenarios, with loads of useful information embedded to assist with game play. https://vasl-templates.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
vasl-templates/vasl_templates/webapp/tests/proto/__init__.py

32 lines
959 B

"""gRPC protobuf definitions (for controlling tests)."""
import sys
import importlib
# ---------------------------------------------------------------------
def _init_classes():
"""Initialize the gRPC classes."""
# process each request/response class
from .utils import get_classes, split_words
for cls in get_classes():
# check if the class has a corresponding module
words = split_words( cls.__name__ )
mod_name = "_".join( words )
try:
mod2 = importlib.import_module( "vasl_templates.webapp.tests.proto." + mod_name )
except ModuleNotFoundError:
continue
# yup - inject the functions into the class
for elem2 in dir(mod2):
obj = getattr( mod2, elem2 )
if not callable( obj ):
continue
setattr( cls, elem2, obj )
# ---------------------------------------------------------------------
_init_classes()