Fixed some tests that were broken when run against the Docker container.

master
Pacman Ghost 4 years ago
parent 59e1517464
commit fbe01fb1f0
  1. 8
      vasl_templates/webapp/tests/remote.py
  2. 5
      vasl_templates/webapp/vasl_mod.py

@ -27,7 +27,7 @@ from vasl_templates.webapp import vasl_mod as vasl_mod_module
_logger = logging.getLogger( "control_tests" ) _logger = logging.getLogger( "control_tests" )
_ORIG_CHAPTER_H_NOTES_DIR = app.config.get( "CHAPTER_H_NOTES_DIR" ) _ORIG_CHAPTER_H_NOTES_DIR = app.config.get( "CHAPTER_H_NOTES_DIR", os.environ.get("CHAPTER_H_NOTES_DIR") )
# --------------------------------------------------------------------- # ---------------------------------------------------------------------
@ -163,7 +163,7 @@ class ControlTests:
app.config[ "VASL_EXTNS_DIR" ] = dname app.config[ "VASL_EXTNS_DIR" ] = dname
else: else:
_logger.info( "Disabling VASL extensions." ) _logger.info( "Disabling VASL extensions." )
app.config.pop( "VASL_EXTNS_DIR", None ) app.config[ "VASL_EXTNS_DIR" ] = None
# configure the VASL module # configure the VASL module
if vmod: if vmod:
@ -176,7 +176,7 @@ class ControlTests:
assert vmod in vmod_fnames assert vmod in vmod_fnames
app.config[ "VASL_MOD" ] = vmod app.config[ "VASL_MOD" ] = vmod
else: else:
app.config.pop( "VASL_MOD", None ) app.config[ "VASL_MOD" ] = None
_logger.info( "Installing VASL module: %s", vmod ) _logger.info( "Installing VASL module: %s", vmod )
# install the new VASL module # install the new VASL module
@ -213,7 +213,7 @@ class ControlTests:
app.config[ "_VASL_EXTN_INFO_DIR_" ] = dname app.config[ "_VASL_EXTN_INFO_DIR_" ] = dname
else: else:
_logger.info( "Using the default VASL extension info directory." ) _logger.info( "Using the default VASL extension info directory." )
app.config.pop( "_VASL_EXTN_INFO_DIR_", None ) app.config[ "_VASL_EXTN_INFO_DIR_" ] = None
return self return self
def _get_vassal_engines( self ): def _get_vassal_engines( self ):

@ -65,9 +65,8 @@ def _load_vasl_extns( extn_dir, msg_store ): #pylint: disable=too-many-locals,to
# load our extension info files # load our extension info files
all_extn_info = {} all_extn_info = {}
if "_VASL_EXTN_INFO_DIR_" in app.config: dname = app.config.get( "_VASL_EXTN_INFO_DIR_" ) # nb: this is set by the test suite
dname = app.config["_VASL_EXTN_INFO_DIR_"] # nb: for the test suite if not dname:
else:
dname = os.path.join( DATA_DIR, "extensions" ) dname = os.path.join( DATA_DIR, "extensions" )
for fname in glob.glob( os.path.join(dname,"*.json") ): for fname in glob.glob( os.path.join(dname,"*.json") ):
_logger.debug( "Loading VASL extension info: %s", fname ) _logger.debug( "Loading VASL extension info: %s", fname )

Loading…
Cancel
Save