Browse Source

Fixed some test failures

pull/753/merge
Armin Ronacher 12 years ago
parent
commit
90e3906d02
  1. 6
      flask/testsuite/basic.py
  2. 1
      flask/testsuite/blueprints.py
  3. 2
      flask/testsuite/helpers.py

6
flask/testsuite/basic.py

@ -513,7 +513,7 @@ class BasicFunctionalityTestCase(FlaskTestCase):
# test that all teardown_requests get passed the same original
# exception.
try:
raise TypeError
raise TypeError()
except:
pass
@app.teardown_request
@ -524,7 +524,7 @@ class BasicFunctionalityTestCase(FlaskTestCase):
# test that all teardown_requests get passed the same original
# exception.
try:
raise TypeError
raise TypeError()
except:
pass
@app.route('/')
@ -1098,7 +1098,9 @@ class SubdomainTestCase(FlaskTestCase):
app.register_module(mod)
c = app.test_client()
rv = c.get('/static/hello.txt', 'http://foo.example.com/')
rv.direct_passthrough = False
self.assert_equal(rv.data.strip(), b'Hello Subdomain')
rv.close()
def test_subdomain_matching(self):
app = flask.Flask(__name__)

1
flask/testsuite/blueprints.py

@ -371,6 +371,7 @@ class BlueprintTestCase(FlaskTestCase):
rv = c.get('/admin/static/css/test.css')
cc = parse_cache_control_header(rv.headers['Cache-Control'])
self.assert_equal(cc.max_age, expected_max_age)
rv.close()
finally:
app.config['SEND_FILE_MAX_AGE_DEFAULT'] = max_age_default

2
flask/testsuite/helpers.py

@ -206,6 +206,7 @@ class SendfileTestCase(FlaskTestCase):
with catch_warnings() as captured:
f = StringIO('Test')
rv = flask.send_file(f)
rv.direct_passthrough = False
self.assert_equal(rv.data, b'Test')
self.assert_equal(rv.mimetype, 'application/octet-stream')
rv.close()
@ -214,6 +215,7 @@ class SendfileTestCase(FlaskTestCase):
with catch_warnings() as captured:
f = StringIO('Test')
rv = flask.send_file(f, mimetype='text/plain')
rv.direct_passthrough = False
self.assert_equal(rv.data, b'Test')
self.assert_equal(rv.mimetype, 'text/plain')
rv.close()

Loading…
Cancel
Save