summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/fixture.py8
-rw-r--r--tests/sample_configs/basic_app.ini5
-rw-r--r--tests/test_basic_app.py12
3 files changed, 25 insertions, 0 deletions
diff --git a/tests/fixture.py b/tests/fixture.py
new file mode 100644
index 0000000..a0f62e7
--- /dev/null
+++ b/tests/fixture.py
@@ -0,0 +1,8 @@
+import os
+from paste.deploy import load
+
+def conf_fn(filename):
+ return os.path.join(os.path.dirname(__file__), 'sample_configs', filename)
+
+def loadtest(base_filename, *args **kw):
+ return load(conf_fn(base_filename), *args, **kw)
diff --git a/tests/sample_configs/basic_app.ini b/tests/sample_configs/basic_app.ini
new file mode 100644
index 0000000..21bf5a2
--- /dev/null
+++ b/tests/sample_configs/basic_app.ini
@@ -0,0 +1,5 @@
+[application:main]
+use = FakeApp basic_app
+
+[application:other]
+use = FakeApp basic_app2
diff --git a/tests/test_basic_app.py b/tests/test_basic_app.py
new file mode 100644
index 0000000..170be42
--- /dev/null
+++ b/tests/test_basic_app.py
@@ -0,0 +1,12 @@
+from paste.deploy import loadwsgi
+from fixture import *
+import fakeapp.apps
+
+def test_main():
+ app = loadtest('basic_app.ini')
+ assert app is fakeapp.apps.basic_app
+
+def test_other():
+ app = loadtest('basic_app.ini', name='other')
+ assert app is fakeapp.apps.basic_app2
+