feat(ui): base.html, macros (badges, lightbox), shared.js, register_shared_ui
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import os
|
||||
from flask import Flask, render_template
|
||||
from photoflow.ui import TEMPLATE_DIR, STATIC_DIR, register_shared_ui
|
||||
|
||||
|
||||
def test_dirs_exist():
|
||||
assert os.path.isfile(os.path.join(TEMPLATE_DIR, "base.html"))
|
||||
assert os.path.isfile(os.path.join(STATIC_DIR, "shared.js"))
|
||||
|
||||
|
||||
def test_register_serves_shared_static_and_template():
|
||||
app = Flask(__name__)
|
||||
register_shared_ui(app)
|
||||
|
||||
@app.route("/page")
|
||||
def page():
|
||||
return render_template("base.html")
|
||||
|
||||
client = app.test_client()
|
||||
r = client.get("/page")
|
||||
assert r.status_code == 200
|
||||
assert b"/shared-static/shared.js" in r.data
|
||||
js = client.get("/shared-static/shared.js")
|
||||
assert js.status_code == 200 and b"photoGrid" in js.data
|
||||
Reference in New Issue
Block a user