diff --git a/vasl_templates/webapp/tests/control_tests_servicer.py b/vasl_templates/webapp/tests/control_tests_servicer.py index e9e8c40..fd27495 100644 --- a/vasl_templates/webapp/tests/control_tests_servicer.py +++ b/vasl_templates/webapp/tests/control_tests_servicer.py @@ -496,8 +496,9 @@ class ControlTestsServicer( BaseControlTestsServicer ): #pylint: disable=too-man if request.HasField( val_type ): key, val = request.key, getattr(request,val_type) _logger.debug( "- Setting app config: %s = %s (%s)", key, str(val), type(val).__name__ ) - if val == "{{TEMP_DIR}}": - val = self._temp_dir.name + if isinstance( val, str ): + val = val.replace( "{{TEMP_DIR}}", self._temp_dir.name ) \ + .replace( "{{FIXTURES_DIR}}", _FIXTURES_DIR ) self._webapp.config[ key ] = val return Empty() raise RuntimeError( "Can't find app config key." ) diff --git a/vasl_templates/webapp/tests/test_aslrb2.py b/vasl_templates/webapp/tests/test_aslrb2.py index f6acd5e..feb2ef1 100644 --- a/vasl_templates/webapp/tests/test_aslrb2.py +++ b/vasl_templates/webapp/tests/test_aslrb2.py @@ -1,7 +1,5 @@ """ Test integration with asl-rulebook2. """ -import os - from vasl_templates.webapp.tests.utils import init_webapp, find_child, find_children from vasl_templates.webapp.tests.test_scenario_persistence import load_scenario @@ -12,7 +10,7 @@ def test_chapter_h( webapp, webdriver ): # initialize webapp.control_tests.set_app_config_val( "ASL_RULEBOOK2_BASE_URL", - os.path.join( os.path.dirname(__file__), "fixtures/asl-rulebook2/vo-note-targets.json" ) + "{{FIXTURES_DIR}}/asl-rulebook2/vo-note-targets.json" ) init_webapp( webapp, webdriver, scenario_persistence=1 ) base_url = "{}/asl-rulebook2/".format( webapp.base_url )