def test_body_get_is_none(): res = Response() res._app_iter = None with pytest.raises(TypeError): Response(app_iter=iter(['a']), body="somebody") with pytest.raises(AttributeError): res.__getattribute__('body')
def test_text_get_no_charset(): res = Response(charset=None) with pytest.raises(AttributeError): res.__getattribute__('text')
def test_body_get_is_unicode(): res = Response(app_iter=(['x'] * 51 + [text_(b'x')])) with pytest.raises(TypeError): res.__getattribute__('body')
def test_body_get_is_unicode_notverylong(): res = Response(app_iter=(text_(b'foo'),)) with pytest.raises(TypeError): res.__getattribute__('body')
def test_body_get_is_unicode(): res = Response(app_iter=(["x"] * 51 + [text_(b"x")])) with pytest.raises(TypeError): res.__getattribute__("body")
def test_body_get_is_unicode(): res = Response(app_iter=(["x"] * 51 + [text_(b"x")])) with pytest.raises(TypeError): res.__getattribute__("body")