forked from orbit-oss/flask
Added a test for sending from directories
This commit is contained in:
parent
76e2f9cd03
commit
8cb79fd026
1 changed files with 10 additions and 0 deletions
|
|
@ -368,6 +368,16 @@ class SendfileTestCase(FlaskTestCase):
|
||||||
self.assert_equal(cc.max_age, 10)
|
self.assert_equal(cc.max_age, 10)
|
||||||
rv.close()
|
rv.close()
|
||||||
|
|
||||||
|
def test_send_from_directory(self):
|
||||||
|
app = flask.Flask(__name__)
|
||||||
|
app.testing = True
|
||||||
|
app.root_path = os.path.join(os.path.dirname(__file__),
|
||||||
|
'test_apps', 'subdomaintestmodule')
|
||||||
|
with app.test_request_context():
|
||||||
|
rv = flask.send_from_directory('static', 'hello.txt')
|
||||||
|
rv.direct_passthrough = False
|
||||||
|
self.assert_equal(rv.get_data().strip(), b'Hello Subdomain')
|
||||||
|
|
||||||
|
|
||||||
class LoggingTestCase(FlaskTestCase):
|
class LoggingTestCase(FlaskTestCase):
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue