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" )
_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
else:
_logger.info( "Disabling VASL extensions." )
app.config.pop( "VASL_EXTNS_DIR", None )
app.config[ "VASL_EXTNS_DIR" ] = None
# configure the VASL module
if vmod:
@ -176,7 +176,7 @@ class ControlTests:
assert vmod in vmod_fnames
app.config[ "VASL_MOD" ] = vmod
else:
app.config.pop( "VASL_MOD", None )
app.config[ "VASL_MOD" ] = None
_logger.info( "Installing VASL module: %s", vmod )
# install the new VASL module
@ -213,7 +213,7 @@ class ControlTests:
app.config[ "_VASL_EXTN_INFO_DIR_" ] = dname
else:
_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
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
all_extn_info = {}
if "_VASL_EXTN_INFO_DIR_" in app.config:
dname = app.config["_VASL_EXTN_INFO_DIR_"] # nb: for the test suite
else:
dname = app.config.get( "_VASL_EXTN_INFO_DIR_" ) # nb: this is set by the test suite
if not dname:
dname = os.path.join( DATA_DIR, "extensions" )
for fname in glob.glob( os.path.join(dname,"*.json") ):
_logger.debug( "Loading VASL extension info: %s", fname )

Loading…
Cancel
Save