Skip to content

Commit d3b7d23

Browse files
committed
add a test to load an app with pastedeploy
1 parent 51f4899 commit d3b7d23

File tree

5 files changed

+15
-2
lines changed

5 files changed

+15
-2
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ docs/_themes/
1515
.project
1616
.pydevproject
1717
.settings/
18-
.coverage
18+
.coverage*
1919
eggs

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
version = '1.4.4.dev0'
99

10-
tests_require = ['nose', 'coverage', 'mock']
10+
tests_require = ['nose', 'coverage', 'mock', 'PasteDeploy', 'WSGIProxy2']
1111
opt_install_requires = []
1212

1313
if sys.version_info[0] == 2:

tests/deploy.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[app:main]
2+
paste.app_factory = webtest.debugapp:make_debug_app
3+
form = <form></form>

tests/test_testing.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import unicode_literals
3+
import os
34
import sys
45
import six
56
import webtest
@@ -95,6 +96,13 @@ def test_bad_content_type(self):
9596
self.assertRaises(AttributeError, lambda: resp.lxml)
9697
self.assertRaises(AttributeError, lambda: resp.xml)
9798

99+
def test_app_from_config_file(self):
100+
config = os.path.join(os.path.dirname(__file__), 'deploy.ini')
101+
app = webtest.TestApp('config:%s#main' % config)
102+
resp = app.get('/')
103+
self.assertEqual(resp.status_int, 200)
104+
105+
98106
def test_errors(self):
99107
try:
100108
self.app.get('/?errorlog=somelogs')

tox.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ deps =
1717
pyquery
1818
mock
1919
BeautifulSoup4
20+
PasteDeploy
21+
WSGIProxy2
2022

2123
[PY2]
2224
deps =

0 commit comments

Comments
 (0)