forked from orbit-oss/flask
Fixed PyStringIO in tests for 2.x
This commit is contained in:
parent
8cb79fd026
commit
001100bc0b
1 changed files with 5 additions and 2 deletions
|
|
@ -265,8 +265,11 @@ class SendfileTestCase(FlaskTestCase):
|
||||||
# etags
|
# etags
|
||||||
self.assert_equal(len(captured), 1)
|
self.assert_equal(len(captured), 1)
|
||||||
with catch_warnings() as captured:
|
with catch_warnings() as captured:
|
||||||
class PyStringIO(StringIO):
|
class PyStringIO(object):
|
||||||
pass
|
def __init__(self, *args, **kwargs):
|
||||||
|
self._io = StringIO(*args, **kwargs)
|
||||||
|
def __getattr__(self, name):
|
||||||
|
return getattr(self._io, name)
|
||||||
f = PyStringIO('Test')
|
f = PyStringIO('Test')
|
||||||
f.name = 'test.txt'
|
f.name = 'test.txt'
|
||||||
rv = flask.send_file(f)
|
rv = flask.send_file(f)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue