Example #1
0
def test_urlopener():
    data = urllib_request('https://httpbin.org/headers',
                          headers=[('User-Agent', 'Mozilla/5.0')],
                          verbose=1,
                          retries=RETRIES)
    assert 'Mozilla' in data
Example #2
0
def test_urlopener():
    data = urllib_request('https://httpbin.org/headers', headers=[('User-Agent', 'Mozilla/5.0')])
    assert 'Mozilla' in data
Example #3
0
def test_urlopener_no_agent():
    data = urllib_request('https://httpbin.org/headers',
                          verbose=1,
                          retries=RETRIES)
    assert 'User-Agent' not in data
Example #4
0
def test_urlopener_no_agent():
    data = urllib_request('https://httpbin.org/headers')
    assert 'User-Agent' not in data