diff options
author | Alex Gr?nholm <alex.gronholm@nextday.fi> | 2011-05-24 02:08:17 +0300 |
---|---|---|
committer | Alex Gr?nholm <alex.gronholm@nextday.fi> | 2011-05-24 02:08:17 +0300 |
commit | bb46e560c30f095b7a5344b64307bd7663b4bea5 (patch) | |
tree | 914b24f48ed37ee33ce17394e5c08d72ecb052f8 /tests/test_config.py | |
parent | a977fb83c12475e71b96c587de785ad423b8f196 (diff) | |
parent | f819a48f6744e2a26386f0035cfb9bc989772514 (diff) | |
download | pastedeploy-bb46e560c30f095b7a5344b64307bd7663b4bea5.tar.gz |
Added support for the call: protocol, contributed by Jason Stitt
Diffstat (limited to 'tests/test_config.py')
-rw-r--r-- | tests/test_config.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test_config.py b/tests/test_config.py index b6cd158..6dee066 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -3,6 +3,7 @@ from nose.tools import eq_ from paste.deploy import loadapp, appconfig from tests.fixture import * import fakeapp.configapps as fc +import fakeapp.apps ini_file = 'config:sample_configs/test_config.ini' @@ -62,6 +63,33 @@ def test_config3(): test_config2() +def test_main(): + app = loadapp('config:test_func.ini', + relative_to=config_path) + assert app is fakeapp.apps.basic_app + app = loadapp('config:test_func.ini#main', + relative_to=config_path) + assert app is fakeapp.apps.basic_app + app = loadapp('config:test_func.ini', + relative_to=config_path, name='main') + assert app is fakeapp.apps.basic_app + app = loadapp('config:test_func.ini#ignored', + relative_to=config_path, name='main') + assert app is fakeapp.apps.basic_app + + +def test_other(): + app = loadapp('config:test_func.ini#other', relative_to=config_path) + assert app is fakeapp.apps.basic_app2 + + +def test_composit(): + app = loadapp('config:test_func.ini#remote_addr', relative_to=config_path) + assert isinstance(app, fakeapp.apps.RemoteAddrDispatch) + assert app.map['127.0.0.1'] is fakeapp.apps.basic_app + assert app.map['0.0.0.0'] is fakeapp.apps.basic_app2 + + def test_foreign_config(): app = loadapp(ini_file, relative_to=here, name='test_foreign_config') assert isinstance(app, fc.SimpleApp) |