File: test_proxy.py

package info (click to toggle)
paste 3.10.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,472 kB
  • sloc: python: 19,960; javascript: 8,028; makefile: 47; sh: 24
file content (17 lines) | stat: -rw-r--r-- 624 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import pytest

from paste import proxy
from paste.fixture import TestApp

# TODO: Skipping this for now as it is unreliable. Ideally we'd run something
# locally and not have to rely on external stuff.
@pytest.mark.skip(reason="httpbin.org is too slow these days")
def test_proxy_to_website():
    # Not the most robust test...
    # need to test things like POSTing to pages, and getting from pages
    # that don't set content-length.
    app = proxy.Proxy('http://httpbin.org')
    app = TestApp(app)
    res = app.get('/')
    # httpbin is a react app now, so hard to read
    assert '<title>httpbin.org</title>' in res