diff --git a/blockd3_tests/app.py b/blockd3_tests/app.py index 416bd51..343b34f 100644 --- a/blockd3_tests/app.py +++ b/blockd3_tests/app.py @@ -18,7 +18,8 @@ def make_app(env="dev"): url_root = { "dev": "/", - "prod": "/dist/" + "prod": "/dist/", + "test": "/dist/" }[env] app_home = os.path.dirname(__file__) @@ -33,13 +34,12 @@ def make_app(env="dev"): static_url_path="/dist", template_folder="..", static_folder=opa(opj(app_home, "..", "dist")) - ) + ), "test": dict( static_url_path="/dist", template_folder="../dist", static_folder=opa(opj(app_home, "..", "dist")) ) - ) }[env] app = Flask(__name__, **cfg) @@ -52,7 +52,7 @@ def home(): kwargs = {} if env != "test": - kwargs(assets()) + kwargs.update(assets()) return render_template("index.html", env=env, **kwargs) @@ -60,7 +60,7 @@ def home(): def frame(): kwargs = {} if env != "test": - kwargs(assets()) + kwargs.update(assets("../frame/")) return render_template("frame/index.html", env=env, **kwargs) diff --git a/fabfile.py b/fabfile.py index 13102a2..af168da 100755 --- a/fabfile.py +++ b/fabfile.py @@ -251,10 +251,22 @@ def serve_dev(): def serve_prod(): serve("prod") +@task +def serve_test(): + serve("test") + + def serve(env): blockd3_path = os.path.abspath(os.path.dirname(__file__)) sys.path.append(blockd3_path) from blockd3_tests.app import make_app app = make_app(env) - app.run(port=[5000, 5001][env=="prod"]) \ No newline at end of file + + port = { + "dev": 5000, + "prod": 5001, + "test": 5002 + }[env] + + app.run(port=port) \ No newline at end of file diff --git a/frame/index.html b/frame/index.html index e21c89b..e873f3a 100644 --- a/frame/index.html +++ b/frame/index.html @@ -9,11 +9,11 @@
{% if env == "dev" %} -{% for script in scripts %} - -{% endfor %} + {% for script in scripts %} + + {% endfor %} {% else %} - + {% endif %} -{% endfor %} + {% for script in scripts %} + + {% endfor %} {% else %} - + {% endif %}