/usr/lib/python2.6/site-packages/novaclient/openstack/common/apiclient
Edit: /usr/lib/python2.6/site-packages/novaclient/openstack/common/apiclient/fake_client.pyc (6226B)
Ñò
=vVc @ s d Z d d k Z d d k Z d d k Z d d k l Z d d k l Z d d d „ Z d e i
f d „ ƒ YZ d e i f d „ ƒ YZ
d S(
s
A fake server that "responds" to API methods with pre-canned responses.
All of these responses come from the spec, so if for some reason the spec's
wrong the tests might raise AssertionError. I've indicated in comments the
places where actual behavior differs from the spec.
iÿÿÿÿN( t parse( t clientc C s˜ | p g } | p g } xw | D]o } y | | j p t ‚ Wq! t j
oB t | i ƒ ƒ i t | | ƒ ƒ } t d t | ƒ ƒ ‚ q! Xq! Wd S( Ns found unexpected keys: %s( t AssertionErrort sett keyst
differencet list( t dctt requiredt optionalt kt
extra_keys( ( s\ /tmp/pip-build-cD3xZi/python-novaclient/novaclient/openstack/common/apiclient/fake_client.pyt assert_has_keys1 s
%t TestResponsec B s e Z d Z d „ Z d „ Z RS( sD Wrap requests.Response and provide a convenient initialization.
c C s t t | ƒ i ƒ t | _ t | t ƒ oÈ | i d d ƒ | _ | i d d ƒ } t | t t f ƒ o# t
i | ƒ | _ h d d 6} n | | _ h } t
i o2 t | i t
i ƒ o | i i d d ƒ | _ n | i d ƒ p | | _ n
| | _ d S(
Nt status_codeiÈ t textt s application/jsons Content-Types utf-8t strictt headers( t superR
t __init__t Truet _content_consumedt
isinstancet dictt getR R t jsont dumpst _contentt sixt PY3t string_typest encodeR ( t selft dataR t default_headers( ( s\ /tmp/pip-build-cD3xZi/python-novaclient/novaclient/openstack/common/apiclient/fake_client.pyR A s c C s6 | i | i j o# | i | i j o | i | i j S( N( R R R ( R! t other( ( s\ /tmp/pip-build-cD3xZi/python-novaclient/novaclient/openstack/common/apiclient/fake_client.pyt __eq__V s ( t __name__t
__module__t __doc__R R% ( ( ( s\ /tmp/pip-build-cD3xZi/python-novaclient/novaclient/openstack/common/apiclient/fake_client.pyR
= s t FakeHTTPClientc B sG e Z d „ Z d d d „ Z d d „ Z d „ Z d „ Z d „ Z RS( c O sa g | _ | i d d ƒ p h | _ | o d | j o
d } n t t | ƒ i | | Ž d S( Nt fixturest auth_plugin( N( t callstackt popt NoneR* R R) R ( R! t argst kwargs( ( s\ /tmp/pip-build-cD3xZi/python-novaclient/novaclient/openstack/common/apiclient/fake_client.pyR ^ s
iÿÿÿÿc C s© | | f } | i | d d !} | i p t d | ‚ | | j p t d | | ‚ | d j oA | i | d | j o% t d | i | d | f ƒ ‚ q¥ n d S( s3 Assert than an API method was just called.
i i s&