summaryrefslogtreecommitdiff
path: root/repoze/bfg/tests/test_paster.py
diff options
context:
space:
mode:
Diffstat (limited to 'repoze/bfg/tests/test_paster.py')
-rw-r--r--repoze/bfg/tests/test_paster.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/repoze/bfg/tests/test_paster.py b/repoze/bfg/tests/test_paster.py
index 3339fe498..0119e3313 100644
--- a/repoze/bfg/tests/test_paster.py
+++ b/repoze/bfg/tests/test_paster.py
@@ -28,6 +28,21 @@ class TestBFGShellCommand(unittest.TestCase):
self.failUnless(interact.banner)
self.assertEqual(len(app.threadlocal_manager.popped), 1)
+class TestGetApp(unittest.TestCase):
+ def _callFUT(self, config_file, section_name, loadapp):
+ from repoze.bfg.paster import get_app
+ return get_app(config_file, section_name, loadapp)
+
+ def test_it(self):
+ import os
+ app = DummyApp()
+ loadapp = DummyLoadApp(app)
+ result = self._callFUT('/foo/bar/myapp.ini', 'myapp', loadapp)
+ self.assertEqual(loadapp.config_name, 'config:/foo/bar/myapp.ini')
+ self.assertEqual(loadapp.section_name, 'myapp')
+ self.assertEqual(loadapp.relative_to, os.getcwd())
+ self.assertEqual(result, app)
+
class Dummy:
pass