File: test_proxy.py

package info (click to toggle)
paste 3.0.6+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,204 kB
  • sloc: python: 18,684; makefile: 17; sh: 7
file content (15 lines) | stat: -rw-r--r-- 485 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from paste import proxy
from paste.fixture import TestApp

import pytest

@pytest.mark.skip(reason="Prevent internet access")
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