Browse Source

Fixed a bug in the testsuite that caused problems when dots where in directory names

pull/309/head
Armin Ronacher 13 years ago
parent
commit
fbd6776e68
  1. 4
      flask/testsuite/config.py
  2. 2
      flask/testsuite/helpers.py

4
flask/testsuite/config.py

@ -29,7 +29,7 @@ class ConfigTestCase(FlaskTestCase):
def test_config_from_file(self):
app = flask.Flask(__name__)
app.config.from_pyfile(__file__.rsplit('.')[0] + '.py')
app.config.from_pyfile(__file__.rsplit('.', 1)[0] + '.py')
self.common_object_test(app)
def test_config_from_object(self):
@ -59,7 +59,7 @@ class ConfigTestCase(FlaskTestCase):
self.assert_(0, 'expected exception')
self.assert_(not app.config.from_envvar('FOO_SETTINGS', silent=True))
os.environ = {'FOO_SETTINGS': __file__.rsplit('.')[0] + '.py'}
os.environ = {'FOO_SETTINGS': __file__.rsplit('.', 1)[0] + '.py'}
self.assert_(app.config.from_envvar('FOO_SETTINGS'))
self.common_object_test(app)
finally:

2
flask/testsuite/helpers.py

@ -231,7 +231,7 @@ class LoggingTestCase(FlaskTestCase):
c.get('/')
out = err.getvalue()
self.assert_('WARNING in helpers [' in out)
self.assert_(os.path.basename(__file__.rsplit('.')[0] + '.py') in out)
self.assert_(os.path.basename(__file__.rsplit('.', 1)[0] + '.py') in out)
self.assert_('the standard library is dead' in out)
self.assert_('this is a debug statement' in out)

Loading…
Cancel
Save