Parent: [3abb2e] (diff)

Child: [ecc23b] (diff)

Download this file

test_middleware.py    27 lines (20 with data), 811 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from os import path, environ
from tg import config
from paste.deploy import loadapp
from paste.script.appinstall import SetupCommand
from paste.deploy import appconfig
from allura.config.middleware import make_app
test_config = environ.get('SF_SYSTEM_FUNC') and 'sandbox-test.ini' or 'test.ini'
def setUp(self):
"""Method called by nose before running each test"""
# Loading the application:
conf_dir = config.here
wsgiapp = loadapp('config:%s#main' % test_config,
relative_to=conf_dir)
# Setting it up:
test_file = path.join(conf_dir, test_config)
cmd = SetupCommand('setup-app')
cmd.run([test_file])
def test_make_app():
conf = appconfig('config:%s#main' % test_config, relative_to=config.here)
make_app(conf.global_conf, **conf.local_conf)