Closed pcpa closed 11 years ago
I made a bug report at https://bugzilla.redhat.com/show_bug.cgi?id=995716 with a link to a python-flask correction to most of this problem. My package, sagemath, that uses python-flask-autoindex works again if using the first chunk of https://github.com/mitsuhiko/flask/commit/44e39ab0 (the second chunk is already applied in the fedora package), but the tests for python-flask-autoindex still fail as initially reported.
I prefer to have it working instead of disabling %check, as currently python-flask-autoindex is FTBFS in fedora in bug report https://bugzilla.redhat.com/show_bug.cgi?id=992891
I got a little bit further by specifying an endpoint explicitly:
diff --git a/tests/__init__.py b/tests/__init__.py
index 8e542c2..613c640 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -135,8 +135,8 @@ class ApplicationTestCase(unittest.TestCase):
self.idx = AutoIndex(self.app, browse_root, add_url_rules=True)
self.idx2 = AutoIndex(self.app2,
silk_options={'silk_path': '/myicons'})
- @self.app2.route('/')
- @self.app2.route('/<path:path>')
+ @self.app2.route('/', endpoint="autoindex_endpoint")
+ @self.app2.route('/<path:path>', endpoint="autoindex_endpoint")
def autoindex(path='.'):
return self.idx2.render_autoindex(path, browse_root)
However, it later fails with
======================================================================
FAIL: test_autoindex (tests.ApplicationTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/sebastian/development/flask-autoindex/tests/__init__.py", line 170, in test_autoindex
assert '__init__.py' in rv.data
AssertionError
and indeed, a simple
import os.path
from flask import Flask
from flask_autoindex import AutoIndex
app = Flask("foo")
idx = AutoIndex(app, add_url_rules=False)
@app.route('/')
@app.route('/<path:path>')
def show_lala(path='.'):
return idx.render_autoindex(path, os.path.curdir)
app.run()
fails with an internal server error.
Sorry guys, I was late. I just fixed the test failure at 5e920c5c7ea675f7cae2f6e83b44209136f9b68d.
I confirm the problem has been corrected. I will first make a python-flask-autoindex-0.4.1 update for fedora rawhide to close the FTBFS bug, then later will try to update to 0.5. Both 0.4.1 and 0.5 needs a minor edit in the commit correcting the problem.
Tests fail with this pattern:
But this is the only failure pattern.