/usr/lib/python2.6/site-packages/cinderclient/tests/unit
Edit: /usr/lib/python2.6/site-packages/cinderclient/tests/unit/test_http.pyc (12328B)
Ñò
=vVc @ s¤ d d k Z d d k Z d d k l Z d d k l Z d d k l Z e i h d d 6d d 6ƒ Z e i h d d 6d d 6ƒ Z e i
d
e ƒ Z e i
d
e ƒ Z e i h d d 6d d 6ƒ Z
e i
d
e
ƒ Z e i h d
d 6d d 6ƒ Z e i
d
e ƒ Z e i h d d 6d d 6ƒ Z e i
d
e ƒ Z e i
d e i i ƒ Z e i
d e i i ƒ Z d d „ Z d d „ Z d d „ Z d e i f d „ ƒ YZ d S( iÿÿÿÿN( t client( t
exceptions( t utilsiÈ t status_codes {"hi": "there"}t texts {"access": {}}t return_valuei s5 {"error": {"message": "n/a", "details": "Terrible!"}}i‘ s8 {"error": {"message": "FAILED!", "details": "DETAILS!"}}iô t side_effecti c C s" t i d d d d d | ƒ} | S( Nt usernamet passwordt
project_idt auth_testt retries( R t
HTTPClient( R t cl( ( sN /tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/tests/unit/test_http.pyt
get_client= s c C s% t d | ƒ } d | _ d | _ | S( NR s http://example.comt token( R t management_urlt
auth_token( R R
( ( sN /tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/tests/unit/test_http.pyt get_authed_clientC s c C s1 t i d d d d d d d | ƒ} d | _ | S( NR R R R
t
bypass_urls volume/v100/R R ( R R R ( R R
( ( sN /tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/tests/unit/test_http.pyt get_authed_bypass_urlJ s
t
ClientTestc B s} e Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z
d „ Z d
„ Z d „ Z
d „ Z RS(
c s\ t ƒ ‰ t i i t d t ƒ t i d t i d d ƒ ƒ ‡ ‡ f d † ƒ ƒ } | ƒ d S( Nt requests time.timeR iÒ c sq ˆ i d ƒ \ } } h d d 6d d 6ˆ i d 6d d 6} t i d d
d | ˆ i ˆ i h d d
6| ƒ d S( Ns /hiR s X-Auth-TokenR s X-Auth-Project-Ids
User-Agents application/jsont Acceptt GETs http://example.com/hit headerst theret hi( t gett
USER_AGENTt mock_requestt assert_called_witht TEST_REQUEST_BASEt assertEqual( t respt bodyR ( R
t self( sN /tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/tests/unit/test_http.pyt
test_get_callW s
( R t mockt patcht objectt requestsR t Mock( R$ R% ( ( R
R$ sN /tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/tests/unit/test_http.pyt test_getT s 3c s· t d d ƒ ‰ t t g ˆ _ ‡ f d † } ‡ f d † } t i i ˆ d | ƒ t i i t d | ƒ t i d t i d d ƒ ƒ ‡ f d
† ƒ ƒ ƒ } | ƒ ˆ i g ˆ i ƒ d S( NR i c s ˆ i i d ƒ } | | | Ž S( Ni ( R) t pop( t argst kwargst next_request( R$ ( sN /tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/tests/unit/test_http.pyR n s c s d ˆ _ d ˆ _ d S( Ns http://example.comR ( R R ( ( R
( sN /tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/tests/unit/test_http.pyt reauthr s t authenticateR s time.timeR iÒ c s ˆ i d ƒ \ } } d S( Ns /hi( R ( R" R# ( R
( sN /tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/tests/unit/test_http.pyR% v s ( R t bad_401_requestR R) R&