Beispiel #1
0
def test_base_post_request_bad_url():
    b = BaseShortener()
    url = '.....'
    with pytest.raises(BadURLException):
        b._post(url)
Beispiel #2
0
def test_base_post_request():
    b = BaseShortener()
    url = 'http://httpbin.org/status/200'
    assert b._post(url).status_code == 200
def test_base_post_request_bad_url():
    shortener = BaseShortener()
    url = "....."
    with pytest.raises(BadURLException):
        shortener._post(url)
def test_base_proxy(proxy_url):
    # pylint: disable=W0621
    shortener = BaseShortener(proxies={"http": proxy_url})
    url = "http://httpbin.org/status/200"
    assert shortener._post(url).status_code == 200
def test_base_post_request():
    shortener = BaseShortener()
    url = "http://httpbin.org/status/200"
    assert shortener._post(url).status_code == 200