Exemplo n.º 1
0
def test_makeload ():	
	aquests.configure (CONCURRENT, callback = makeload) # cioncurrent
	for i in range (CONCURRENT): 
		aquests.get ("http://127.0.0.1:5000/", meta = {'_id': _ID})
		_ID += 1
		
	aquests.fetchall ()
Exemplo n.º 2
0
def test_mix_get_mongodb():
    dbo = aquests.mongodb("127.0.0.1:27017", "test_database")
    aquests.configure(20)
    for i in range(1000):
        aquests.get("http://127.0.0.1:5000/")
        dbo.findone("posts", {"author": "Hans Roh"})
    aquests.fetchall()
Exemplo n.º 3
0
def test_8():
    munreq = 3000
    aquests.configure(10, callback=increase, force_http1=True)
    for i in range(munreq):
        aquests.get(SERVER)
    aquests.fetchall()
    assertEqual(checkout(), munreq)
Exemplo n.º 4
0
def test_9():
    munreq = 3000
    aquests.configure(2, callback=increase, http2_constreams=5)
    for i in range(munreq):
        aquests.get(SERVER)
    aquests.fetchall()
    assertEqual(checkout(), munreq)
Exemplo n.º 5
0
def test_get_proxypass_post():
    aquests.configure(1, callback=finish_request, force_http1=0)
    for i in range(5):
        aquests.postform("http://127.0.0.1:5000/lb/lib/login.htm",
                         {'fid': 'i' * 105535})
        #aquests.postform ("http://127.0.0.1:5000/lb/lib/login.htm", {'fid': 'i' * 1055})
    aquests.fetchall()
Exemplo n.º 6
0
def test_upload():
    formdata = {'submit-name': 'Hans Roh', "file1": open("./README.txt", "rb")}

    aquests.configure(10)
    for i in range(100):
        aquests.upload("http://127.0.0.1:5000/upload", formdata)
    aquests.fetchall()
Exemplo n.º 7
0
def test_websocket_session (launch):
    with launch ("./examples/websocket.py") as engine:
        aquests.configure (1, callback = assert_status)
        websocket = "ws://127.0.0.1:30371"
        aquests.ws (websocket + "/websocket/echo4", "I'm a Websocket", callback = assert_status2)
        aquests.ws (websocket + "/websocket/echo4", "I'm a Websocket", callback = assert_status3)
        aquests.fetchall ()
Exemplo n.º 8
0
def test_get_https():
    aquests.configure(force_http1=1)
    aquests.get("https://www.facebook.com/")
    aquests.fetchall()

    aquests.configure(force_http1=0)
    aquests.get("https://www.facebook.com/")
    aquests.fetchall()
Exemplo n.º 9
0
def test_https(launch):
    global ERRS
    ERRS = 0
    with launch("./examples/https.py", ssl=True) as engine:
        aquests.configure(2, callback=assert_status)
        [makeset(1) for i in range(2)]
        aquests.fetchall()
        assert ERRS < 4
Exemplo n.º 10
0
def test_dns_error():
    ERRS = 0
    aquests.configure(1, callback=assert_status, force_http1=1)
    [
        aquests.get("http://sdfiusdoiksdflsdkfjslfjlsf.com",
                    meta={"expect": 704}) for i in range(2)
    ]
    aquests.fetchall()

    assert ERRS == 0
Exemplo n.º 11
0
def test_app(launch):
    global ERRS
    ERRS = 0
    with launch("./examples/app.py") as engine:
        aquests.configure(2, callback=assert_status, force_http1=True)
        [makeset(http2=False) for i in range(2)]
        aquests.fetchall()
        assert ERRS < 4

        ERRS = 0
        aquests.configure(1, callback=assert_status)
        [makeset(http2=True) for i in range(2)]
        aquests.fetchall()
        assert ERRS < 4

        ERRS = 0
        aquests.configure(1, callback=assert_status, http2_constreams=2)
        [makeset(http2=True) for i in range(2)]
        aquests.fetchall()
        assert ERRS < 4

        ERRS = 0
        aquests.configure(1, callback=assert_status)
        [make_stream_set() for i in range(4)]
        aquests.fetchall()
        assert ERRS < 4
Exemplo n.º 12
0
def test_load(h1, client, streams, urls):
    if urls == 1:
        aquests.configure(client,
                          callback=request_finished,
                          force_http1=h1,
                          http2_constreams=streams)
        for i in range(TOTAL):
            make_example_testset()
    else:
        aquests.configure(client,
                          callback=request_finished_and_req,
                          force_http1=h1,
                          http2_constreams=streams,
                          backend=True)
        for i in range(client * streams):
            for url in urls:
                aquests.get(url)
    aquests.fetchall()
Exemplo n.º 13
0
def test_1():
    aquests.configure(1, callback=equal200)
    aquests.get(SERVER)
    aquests.fetchall()
Exemplo n.º 14
0
def test_2():
    aquests.configure(1, callback=ver20)
    aquests.get(SERVER)
    aquests.fetchall()
Exemplo n.º 15
0
def test_get_301_h2c():
    aquests.configure(callback=finish_request)
    for i in range(1):
        aquests.get("http://127.0.0.1:5000/redirect1")
    aquests.fetchall()
Exemplo n.º 16
0
def test_6():
    aquests.configure(1, callback=equal404)
    aquests.get(SERVER + "/no-page")
    aquests.fetchall()
Exemplo n.º 17
0
def test_3():
    aquests.configure(1, callback=ver11, force_http1=True)
    aquests.get(SERVER)
    aquests.fetchall()
Exemplo n.º 18
0
def test_rpc():
    aquests.configure(10)
    stub = aquests.rpc("http://127.0.0.1:5000/rpc2")
    for i in range(30):
        stub.add_number(5, 7)
    aquests.fetchall()
Exemplo n.º 19
0
def test_7():
    aquests.configure(1, callback=equal404, force_http1=True)
    aquests.get(SERVER + "/no-page")
    aquests.fetchall()
Exemplo n.º 20
0
def test_get():
    aquests.configure(1, callback=request_finished)
    aquests.get("https://gitlab.com/hansroh")
    aquests.fetchall()
Exemplo n.º 21
0
def test_cookie():
    aquests.configure(1, cookie=True, callback=request_finished)
    aquests.get(
        "https://www.google.co.kr/?gfe_rd=cr&ei=3y14WPCTG4XR8gfSjoK4DQ")
    aquests.get("https://aws.amazon.com/")
    aquests.fetchall()
Exemplo n.º 22
0
def test_dns ():
	aquests.configure (1, callback = request_finished)	
	aquests.get ("http://rdsapi.skitai.com:5000/")
	aquests.fetchall ()
Exemplo n.º 23
0
def test_get_301_h2():
    aquests.configure(callback=finish_request, allow_redirects=1)
    for i in range(1):
        aquests.get("https://www.google.com/")
    aquests.fetchall()
Exemplo n.º 24
0
def get_all_20_cs10():
    aquests.configure(2000, http2_constreams=1, force_http1=1)
    for i in range(3000):
        aquests.get("http://127.0.0.1:5000/")
    aquests.fetchall()
Exemplo n.º 25
0
def test_10():
    aquests.configure(1, callback=equal404)
    for i in range(10):
        aquests.get(SERVER + "/no-page")
    aquests.fetchall()
Exemplo n.º 26
0
def test_postform ():
	aquests.configure (10)
	for i in range (100):
		aquests.postjson ("http://127.0.0.1:5000/post", {'username': '******' * 1000000})
	aquests.fetchall ()
Exemplo n.º 27
0
def test_auth_bearer ():	
	aquests.configure (force_http1 = 1, timeout = 20)
	for i in range (1):
		aquests.get ("http://localhost:5000/lb/board/lists/?id=classic&page=1", auth = ("12345678-1234-123456",))
	aquests.fetchall ()
Exemplo n.º 28
0
def test_get_401():
    aquests.configure(callback=finish_request, force_http1=0)
    for i in range(1):
        aquests.get("http://127.0.0.1:5000/", auth=('admin', '1111'))
    aquests.fetchall()
Exemplo n.º 29
0
def test_timeout ():
    aquests.configure (1, timeout = 3)	
    aquests.get ("http://127.0.0.1:5000/test/sleep/20")
    aquests.fetchall ()
Exemplo n.º 30
0
def test_get_all_static():
    aquests.configure(2, callback=None, force_http_11=False)
    for i in range(200):
        aquests.get("http://127.0.0.1:5000/images/gif1.gif")
        #aquests.get ("http://127.0.0.1:5000/images/concept.png")
    aquests.fetchall()