def test_multiline(self): l = """ GET "/foo" ir,@1 """ r = rparse.parse_request({}, l) assert r.method == "GET" assert r.path == "/foo" assert r.actions l = """ GET "/foo bar" ir,@1 """ r = rparse.parse_request({}, l) assert r.method == "GET" assert r.path.s.endswith("bar") assert r.actions
def test_simple(self): r = rparse.parse_request({}, 'GET:"/foo"') assert r.method == "GET" assert r.path == "/foo" r = rparse.parse_request({}, 'GET:/foo') assert r.path == "/foo" r = rparse.parse_request({}, 'GET:@1k') assert len(r.path) == 1024
def test_str(self): r = rparse.parse_request({}, 'GET:"/foo"') assert str(r)
def test_render(self): s = cStringIO.StringIO() r = rparse.parse_request({}, "GET:'/foo'") assert r.serve(s, None, "foo.com")
def test_file(self): p = tutils.test_data.path("data") d = dict(staticdir=p) r = rparse.parse_request(d, "+request") assert r.path == "/foo"