Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(46)  |  Call(44)  |  Derive(0)  |  Import(2)

src/g/r/gruvi-HEAD/tests/test_http.py   gruvi(Download)
import gruvi
from gruvi.http import *
from gruvi.http import HttpParser, HttpMessage, urlsplit2, split_header_options
from support import *
 
    def test_simple_request(self):
        r = b'GET / HTTP/1.1\r\nHost: example.com\r\n\r\n'
        parser = HttpParser()
        nbytes = parser.feed(r)
        self.assertEqual(nbytes, len(r))
    def test_request_with_body(self):
        r = b'GET / HTTP/1.1\r\nHost: example.com\r\n' \
            b'Content-Length: 3\r\n\r\nFoo'
        parser = HttpParser()
        nbytes = parser.feed(r)
    def test_request_with_body_incremental(self):
        r = b'GET / HTTP/1.1\r\nHost: example.com\r\n' \
            b'Content-Length: 3\r\n\r\nFoo'
        parser = HttpParser()
        for i in range(len(r)):
    def test_request_with_chunked_body(self):
        r = b'GET / HTTP/1.1\r\nHost: example.com\r\n' \
            b'Transfer-Encoding: chunked\r\n\r\n' \
            b'3\r\nFoo\r\n0\r\n\r\n'
        parser = HttpParser()

src/g/r/gruvi-0.9.2/tests/test_http.py   gruvi(Download)
import time
import gruvi
from gruvi.http import HttpParser, HttpMessage, HttpServer, HttpClient
from support import *
 
    def test_simple_request(self):
        r = b'GET / HTTP/1.1\r\nHost: example.com\r\n\r\n'
        parser = HttpParser()
        nbytes = parser.feed(r)
        self.assertEqual(nbytes, len(r))
    def test_request_with_body(self):
        r = b'GET / HTTP/1.1\r\nHost: example.com\r\n' \
            b'Content-Length: 3\r\n\r\nFoo'
        parser = HttpParser()
        nbytes = parser.feed(r)
    def test_request_with_body_incremental(self):
        r = b'GET / HTTP/1.1\r\nHost: example.com\r\n' \
            b'Content-Length: 3\r\n\r\nFoo'
        parser = HttpParser()
        for i in range(len(r)):
    def test_request_with_chunked_body(self):
        r = b'GET / HTTP/1.1\r\nHost: example.com\r\n' \
            b'Transfer-Encoding: chunked\r\n\r\n' \
            b'3\r\nFoo\r\n0\r\n\r\n'
        parser = HttpParser()