• Home
  • Raw
  • Download

Lines Matching refs:assert_

126 def assert_(cond, *args):  function
149 assert_(len(args) == 2, "Two arguments required")
150 assert_(not kw, "No keyword arguments allowed")
160 assert_(len(args) == 2 or len(args) == 3, (
162 assert_(not kw, "No keyword arguments allowed")
182 assert_(iterator is not None and iterator != False,
197 assert_(len(args) == 1)
199 assert_(type(v) is bytes)
203 assert_(len(args) <= 1)
205 assert_(type(v) is bytes)
209 assert_(len(args) <= 1)
211 assert_(type(lines) is list)
213 assert_(type(line) is bytes)
224 assert_(0, "input.close() must not be called")
232 assert_(type(s) is str)
243 assert_(0, "errors.close() must not be called")
251 assert_(type(s) is bytes)
275 assert_(not self.closed,
279 assert_(False, "Iterator yielded non-bytestring (%r)" % (v,))
281 assert_(self.check_start_response,
295 assert_(self.closed,
299 assert_(type(environ) is dict,
307 assert_(key in environ,
311 assert_(key not in environ,
326 assert_(type(environ[key]) is str,
330 assert_(type(environ['wsgi.version']) is tuple,
332 assert_(environ['wsgi.url_scheme'] in ('http', 'https'),
345 assert_(not environ.get('SCRIPT_NAME')
348 assert_(not environ.get('PATH_INFO')
352 assert_(int(environ['CONTENT_LENGTH']) >= 0,
356 assert_('PATH_INFO' in environ,
359 assert_(environ.get('SCRIPT_NAME') != '/',
365 assert_(hasattr(wsgi_input, attr),
371 assert_(hasattr(wsgi_errors, attr),
379 assert_(len(status_code) == 3,
382 assert_(status_int >= 100, "Status code is invalid: %r" % status_int)
390 assert_(type(headers) is list,
394 assert_(type(item) is tuple,
397 assert_(len(item) == 2)
401 assert_(name.lower() != 'status',
405 assert_('\n' not in name and ':' not in name,
407 assert_(header_re.search(name), "Bad header name: %r" % name)
408 assert_(not name.endswith('-') and not name.endswith('_'),
411 assert_(0, "Bad header value: %r (bad char: %r)"
425 assert_(0, ("Content-Type header found in a %s response, "
428 assert_(0, "No Content-Type header found in headers (%s)" % headers)
431 assert_(exc_info is None or type(exc_info) is tuple,
439 assert_(not isinstance(iterator, (str, bytes)),