/usr/lib/python2.6/site-packages/pbr/tests
Edit: /usr/lib/python2.6/site-packages/pbr/tests/test_wsgi.pyc (4506B)
Ñò
;vVc @ s» d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z y d d k l Z Wn# e j
o d d k l Z n Xd d k
Z
d d k l Z d e i
f d „ ƒ YZ d S( iÿÿÿÿN( t urlopen( t baset TestWsgiScriptsc B s2 e Z d Z d „ Z d „ Z d „ Z d „ Z RS( t
pbr_test_wsgit pbr_test_wsgi_with_classc C s‹ t i d j o | i d ƒ n | i d d | i ƒ \ } } } | i t i d d | i t i d t i d f ƒ ƒ | i
| ƒ d S(
s5 Test that we install a non-pkg-resources wsgi script.t nts Windows support is passthrought installs --prefix=%st
PYTHONPATHs" .:%s/lib/python%s.%s/site-packagesi i N( t ost namet skipTestt run_setupt temp_dirt
useFixturet fixturest EnvironmentVariablet syst version_infot _check_wsgi_install_content( t selft stdoutt _t return_code( ( s0 /tmp/pip-build-cD3xZi/pbr/pbr/tests/test_wsgi.pyt test_wsgi_script_install% s
c C s» | i d ƒ t i d j o | i d ƒ n | i d d | i ƒ \ } } } | i t i d d | i t i d t i d f ƒ ƒ | i t i d
d ƒ ƒ | i
| ƒ | i ƒ d S(
s2 Test that we install a runnable wsgi script.
This test actually attempts to start and interact with the
wsgi script in question to demonstrate that it's a working
wsgi script using simple server. It's a bit hokey because of
process management that has to be done.
s` Test skipped until we can determine a reliable way to capture subprocess stdout without blockingR s Windows support is passthroughR s --prefix=%sR s" .:%s/lib/python%s.%s/site-packagesi i t PYTHONUNBUFFEREDt 1N( R
R R R R R
R R R R R t
_test_wsgi( R R R R ( ( s0 /tmp/pip-build-cD3xZi/pbr/pbr/tests/test_wsgi.pyt test_wsgi_script_run6 s
c C s\ xU| i D]J} t i i | i d | ƒ } t i ƒ } d | | i f GHt i d | | i f d t
d t
d | i ƒ} | i | i ƒ t
i d ƒ | i ƒ } | i d | ƒ | i d | ƒ t i d
| ƒ } | i | d | ƒ t | i d ƒ ƒ } | i d
| i ƒ ƒ t
i d ƒ | i ƒ t
i d ƒ | i ƒ } | i d | ƒ q
Wd S( Nt bins Running %s > %ss %s -p 0 > %s 2>&1t shellt close_fdst cwdgš™™™™™¹?s) STARTING test server pbr_testpackage.wsgis2 DANGER! For testing only, do not use in productions (http://[^:]+:\d+)/s Regex failed to match on %si s Hello Worlds "GET / HTTP/1.1" 200 11( t cmd_namesR t patht joinR t tempfilet NamedTemporaryFileR t
subprocesst Popent Truet
addCleanupt killt timet sleept readt assertInt ret searcht assertIsNotNoneR t groupt assertEqual( R t cmd_namet cmdR t pt
stdoutdatat mt f( ( s0 /tmp/pip-build-cD3xZi/pbr/pbr/tests/test_wsgi.pyR Z s8
c
C sÞ x× | i D]Ì } d | | i f } | i | | ƒ t i i | i d | ƒ } t | d ƒ i ƒ } | i d | ƒ d } | d j o
d } n d } d | } d
} | i | | ƒ | i | | ƒ | i | | ƒ q
Wd S( Ns Installing %s script to %sR t rt
pkg_resourcessh if __name__ == "__main__":
import argparse
import socket
import wsgiref.simple_server as wssR t mains WSGI.apps, STARTING test server pbr_testpackage.wsgi.%ss else:
application = None( R R R- R R! R" t openR, t assertNotIn(
R t install_stdoutR3 t install_txtt cmd_filenamet
script_txtt
main_blockt app_namet starting_blockt
else_block( ( s0 /tmp/pip-build-cD3xZi/pbr/pbr/tests/test_wsgi.pyR Ž s$
( s
pbr_test_wsgiR ( t __name__t
__module__R R R R R ( ( ( s0 /tmp/pip-build-cD3xZi/pbr/pbr/tests/test_wsgi.pyR ! s
$ 4( R R. R% R R# R* t urllib2R t ImportErrort urllib.requestR t pbr.testsR t BaseTestCaseR ( ( ( s0 /tmp/pip-build-cD3xZi/pbr/pbr/tests/test_wsgi.pyt
s