From 047efac537abad9e3880f545d8b767f6e6be3786 Mon Sep 17 00:00:00 2001 From: jphilipsen05 Date: Thu, 2 Jun 2016 17:56:08 -0700 Subject: [PATCH] Coverage for test_static_path_deprecated and test_static_url_path (#1860) --- tests/test_basic.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/test_basic.py b/tests/test_basic.py index 8c5b0def..45cad691 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -1116,6 +1116,25 @@ def test_static_files(): rv.close() +def test_static_path_deprecated(): + with pytest.deprecated_call(): + app = flask.Flask(__name__, static_path='/foo') + app.testing = True + rv = app.test_client().get('/foo/index.html') + assert rv.status_code == 200 + with app.test_request_context(): + assert flask.url_for('static', filename='index.html') == '/foo/index.html' + + +def test_static_url_path(): + app = flask.Flask(__name__, static_url_path='/foo') + app.testing = True + rv = app.test_client().get('/foo/index.html') + assert rv.status_code == 200 + with app.test_request_context(): + assert flask.url_for('static', filename='index.html') == '/foo/index.html' + + def test_none_response(): app = flask.Flask(__name__) app.testing = True