예제 #1
0
def test_after_start():
    res = do_request(after_start_response_app, 200)
    res = strip_html(str(res))
    assert 'ValueError: error2' in res
    # This assertion assumes that the start_response_app returns on line 45
    # of this file.
    assert ':48' in res
예제 #2
0
def test_after_start():
    res = do_request(after_start_response_app, 200)
    res = strip_html(str(res))
    assert 'ValueError: error2' in res
	# This assertion assumes that the start_response_app returns on line 45
	# of this file.
    assert ':48' in res
예제 #3
0
def test_makes_exception():
    res = do_request(bad_app)
    assert '<html' in res
    res = strip_html(str(res.body))
    assert 'bad_app() takes no arguments (2 given' in res
    assert 'application(environ, sr_checker)' in res
    assert 'webtest.lint' in res
    assert 'weberror.errormiddleware' in res
예제 #4
0
def test_makes_exception():
    res = do_request(bad_app)
    assert '<html' in res
    res = strip_html(str(res.body))
    assert 'bad_app() takes no arguments (2 given' in res
    assert 'application(environ, sr_checker)' in res
    assert 'webtest.lint' in res
    assert 'weberror.errormiddleware' in res
예제 #5
0
def test_makes_exception():
    res = do_request(bad_app)
    assert '<html' in res
    res = strip_html(str(res))
    #print res
    assert 'bad_app() takes no arguments (2 given' in res
    assert 'iterator = application(environ, start_response_wrapper)' in res
    assert 'paste.lint' in res
    assert 'paste.exceptions.errormiddleware' in res
예제 #6
0
def test_makes_exception():
    res = do_request(bad_app)
    assert '<html' in res
    res = strip_html(str(res))
    #print res
    assert 'bad_app() takes no arguments (2 given' in res
    assert 'iterator = application(environ, start_response_wrapper)' in res
    assert 'paste.lint' in res
    assert 'paste.exceptions.errormiddleware' in res
예제 #7
0
def test_start_res():
    res = do_request(start_response_app)
    res = strip_html(str(res))
    #print res
    assert 'ValueError: hi' in res
    assert 'test_error_middleware' in res
    # This assertion assumes that the start_response_app returns on line 45
    # of this file.
    assert ':44 in start_response_app' in res
예제 #8
0
def test_start_res():
    res = do_request(start_response_app)
    res = strip_html(str(res))
    #print res
    assert 'ValueError: hi' in res
    assert 'test_error_middleware' in res
	# This assertion assumes that the start_response_app returns on line 45
	# of this file.
    assert ':44 in start_response_app' in res
def test_makes_exception():
    res = do_request(bad_app)
    assert '<html' in res
    res = strip_html(str(res))
    if six.PY3:
        assert 'bad_app() takes 0 positional arguments but 2 were given' in res
    else:
        assert 'bad_app() takes no arguments (2 given' in res, repr(res)
    assert 'iterator = application(environ, start_response_wrapper)' in res
    assert 'paste.lint' in res
    assert 'paste.exceptions.errormiddleware' in res
예제 #10
0
def test_hide_after():
    for f in formats:
        try:
            pass_through(
                'AABB',
                hide,
                'after',
                pass_through,
                'CCDD',
                # A little whitespace to keep this line out of the
                # content part of the report
                hide,
                'reset',
                raise_error)
        except:
            result = format(f)
            print strip_html(result).encode('ascii', 'replace')
            assert 'AABB' in result
            assert 'CCDD' not in result
            assert 'raise_error' in result
        else:
            assert 0
def test_hide_after():
    for f in formats:
        try:
            pass_through(
                "AABB",
                hide,
                "after",
                pass_through,
                "CCDD",
                # A little whitespace to keep this line out of the
                # content part of the report
                hide,
                "reset",
                raise_error,
            )
        except:
            result = format(f)
            print strip_html(result).encode("ascii", "replace")
            assert "AABB" in result
            assert "CCDD" not in result
            assert "raise_error" in result
        else:
            assert 0
예제 #12
0
def test_hide_after():
    for f in formats:
        try:
            pass_through(
                'AABB',
                hide, 'after',
                pass_through, 'CCDD',
                # A little whitespace to keep this line out of the
                # content part of the report


                hide, 'reset',
                raise_error)
        except:
            result = format(f)
            print(strip_html(result).encode('ascii', 'replace'))
            assert 'AABB' in result
            assert 'CCDD' not in result
            assert 'raise_error' in result
        else:
            assert 0
 def plain(self, environ):
     """ text/plain representation of the exception """
     body = self.make_body(environ, strip_html(self.template), no_quote)
     return ('%s %s\r\n%s\r\n' % (self.code, self.title, body))
예제 #14
0
파일: httpexceptions.py 프로젝트: 10sr/hue
 def plain(self, environ):
     """ text/plain representation of the exception """
     body = self.make_body(environ, strip_html(self.template), no_quote, comment_quote)
     return ('%s %s\r\n%s\r\n' % (self.code, self.title, body))
예제 #15
0
def test_start_res():
    res = do_request(start_response_app)
    res = strip_html(str(res))
    assert 'ValueError: hi' in res
    assert 'test_error_middleware' in res
    assert ':52 in start_response_app' in res
예제 #16
0
def test_after_start():
    res = do_request(after_start_response_app, 200)
    res = strip_html(str(res))
    #print res
    assert 'ValueError: error2' in res
예제 #17
0
def test_start_res():
    res = do_request(start_response_app)
    res = strip_html(str(res))
    assert 'ValueError: hi' in res
    assert 'test_error_middleware' in res
    assert ':52 in start_response_app' in res
예제 #18
0
def test_after_start():
    res = do_request(after_start_response_app, 200)
    res = strip_html(str(res))
    #print res
    assert 'ValueError: error2' in res