Ejemplo n.º 1
0
def test_ratelimit():
    mock_index()
    url = 'http://www.reddit.com/'
    r = Redditor()
    start = time.time()
    r.get(url)
    r.get(url)
    end = time.time()
    assert end - start > 2
Ejemplo n.º 2
0
def test_ratelimit():
    mock_index()
    url = 'http://www.reddit.com/'
    r = Redditor()
    start = time.time()
    r.get(url)
    r.get(url)
    end = time.time()
    assert end - start > 2
Ejemplo n.º 3
0
def test_useragent():
    mock_index()
    r = Redditor(bypass_ratelimit=True)
    r.get('http://www.reddit.com')
    h = httpretty.last_request().headers
    assert r.headers['User-Agent'] == h['User-Agent']
Ejemplo n.º 4
0
def test_useragent():
    mock_index()
    r = Redditor(bypass_ratelimit=True)
    r.get('http://www.reddit.com')
    h = httpretty.last_request().headers
    assert r.headers['User-Agent'] == h['User-Agent']