MCPcopy Create free account
hub / github.com/Pylons/webtest / test_no_query_string

Method test_no_query_string

tests/test_lint.py:175–195  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

173
174class TestCheckEnviron(unittest.TestCase):
175 def test_no_query_string(self):
176 environ = {
177 'REQUEST_METHOD': 'GET',
178 'SERVER_NAME': 'localhost',
179 'SERVER_PORT': '80',
180 'wsgi.version': (1, 0, 1),
181 'wsgi.input': StringIO('test'),
182 'wsgi.errors': StringIO(),
183 'wsgi.multithread': None,
184 'wsgi.multiprocess': None,
185 'wsgi.run_once': None,
186 'wsgi.url_scheme': 'http',
187 'PATH_INFO': '/',
188 }
189 with warnings.catch_warnings(record=True) as w:
190 warnings.simplefilter("always")
191 check_environ(environ)
192 self.assertEqual(len(w), 1, "We should have only one warning")
193 self.assertTrue(
194 "QUERY_STRING" in str(w[-1].message),
195 "The warning message should say something about QUERY_STRING")
196
197 def test_no_valid_request(self):
198 environ = {

Callers

nothing calls this directly

Calls 1

check_environFunction · 0.90

Tested by

no test coverage detected