Lines Matching refs:assert_

127 def assert_(cond, *args):
144 assert_(len(args) == 2, "Two arguments required")
145 assert_(not kw, "No keyword arguments allowed")
155 assert_(len(args) == 2 or len(args) == 3, (
157 assert_(not kw, "No keyword arguments allowed")
177 assert_(iterator is not None and iterator != False,
192 assert_(len(args) <= 1)
194 assert_(type(v) is type(""))
199 assert_(type(v) is type(""))
203 assert_(len(args) <= 1)
205 assert_(type(lines) is type([]))
207 assert_(type(line) is type(""))
218 assert_(0, "input.close() must not be called")
226 assert_(type(s) is type(""))
237 assert_(0, "errors.close() must not be called")
245 assert_(type(s) is type(""))
269 assert_(not self.closed,
273 assert_(self.check_start_response,
287 assert_(self.closed,
291 assert_(type(environ) is DictType,
299 assert_(key in environ,
303 assert_(key not in environ,
318 assert_(type(environ[key]) is StringType,
322 assert_(type(environ['wsgi.version']) is TupleType,
324 assert_(environ['wsgi.url_scheme'] in ('http', 'https'),
337 assert_(not environ.get('SCRIPT_NAME')
340 assert_(not environ.get('PATH_INFO')
344 assert_(int(environ['CONTENT_LENGTH']) >= 0,
348 assert_('PATH_INFO' in environ,
351 assert_(environ.get('SCRIPT_NAME') != '/',
357 assert_(hasattr(wsgi_input, attr),
363 assert_(hasattr(wsgi_errors, attr),
368 assert_(type(status) is StringType,
372 assert_(len(status_code) == 3,
375 assert_(status_int >= 100, "Status code is invalid: %r" % status_int)
383 assert_(type(headers) is ListType,
388 assert_(type(item) is TupleType,
391 assert_(len(item) == 2)
393 assert_(name.lower() != 'status',
398 assert_('\n' not in name and ':' not in name,
400 assert_(header_re.search(name), "Bad header name: %r" % name)
401 assert_(not name.endswith('-') and not name.endswith('_'),
404 assert_(0, "Bad header value: %r (bad char: %r)"
416 assert_(0, ("Content-Type header found in a %s response, "
419 assert_(0, "No Content-Type header found in headers (%s)" % headers)
422 assert_(exc_info is None or type(exc_info) is type(()),
430 assert_(not isinstance(iterator, str),