Skip to content

Commit 09077a4

Browse files
committed
tweaks
1 parent 24195c6 commit 09077a4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/test_mig_cgibin_cat.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
from mig.shared.functionality.cat import _main as main
1212

1313

14-
def create_wsgi_environ(configuration, wsgi_variables={}):
14+
def create_http_environ(configuration, wsgi_variables={}):
15+
"""Small helper that can create a minimum viable environ dict suitable
16+
for passing to http-facing code for the supplied configuration."""
17+
1518
environ = {}
16-
environ['wsgi.input'] = ()
1719
environ['MIG_CONF'] = configuration.config_file
1820
environ['HTTP_HOST'] = wsgi_variables.get('http_host', 'localhost')
1921
environ['PATH_INFO'] = wsgi_variables.get('path_info', '/')
@@ -40,7 +42,7 @@ def before_each(self):
4042

4143
# create the test user home directory
4244
self.test_user_dir = _temppath(os.path.join(user_home, client_dir), self, ensure_dir=True)
43-
self.test_environ = create_wsgi_environ(self.configuration)
45+
self.test_environ = create_http_environ(self.configuration)
4446

4547
def test_returns_file_output_with_single_file_match(self):
4648
with open(os.path.join(self.test_user_dir, 'foobar.txt'), 'w'):

0 commit comments

Comments
 (0)