"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/test_basic.py" between
flask-1.1.1.tar.gz and flask-1.1.2.tar.gz

About: Flask is a lightweight Python WSGI web application framework.

test_basic.py  (flask-1.1.1):test_basic.py  (flask-1.1.2)
skipping to change at line 1364 skipping to change at line 1364
rv = app.test_client().open("/static/index.html", method="GET") rv = app.test_client().open("/static/index.html", method="GET")
assert rv.status_code == 200 assert rv.status_code == 200
rv.close() rv.close()
def test_static_url_empty_path_default(app): def test_static_url_empty_path_default(app):
app = flask.Flask(__name__, static_folder="") app = flask.Flask(__name__, static_folder="")
rv = app.test_client().open("/static/index.html", method="GET") rv = app.test_client().open("/static/index.html", method="GET")
assert rv.status_code == 200 assert rv.status_code == 200
rv.close() rv.close()
def test_static_folder_with_ending_slash():
app = flask.Flask(__name__, static_folder="static/")
@app.route("/<path:path>")
def catch_all(path):
return path
rv = app.test_client().get("/catch/all")
assert rv.data == b"catch/all"
def test_static_route_with_host_matching(): def test_static_route_with_host_matching():
app = flask.Flask(__name__, host_matching=True, static_host="example.com") app = flask.Flask(__name__, host_matching=True, static_host="example.com")
c = app.test_client() c = app.test_client()
rv = c.get("http://example.com/static/index.html") rv = c.get("http://example.com/static/index.html")
assert rv.status_code == 200 assert rv.status_code == 200
rv.close() rv.close()
with app.test_request_context(): with app.test_request_context():
rv = flask.url_for("static", filename="index.html", _external=True) rv = flask.url_for("static", filename="index.html", _external=True)
assert rv == "http://example.com/static/index.html" assert rv == "http://example.com/static/index.html"
# Providing static_host without host_matching=True should error. # Providing static_host without host_matching=True should error.
 End of changes. 1 change blocks. 
0 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)