[openstack-dev] [novaclient] novaclient and httpretty - unable to record
George Shuklin
george.shuklin at gmail.com
Tue Apr 4 09:43:40 UTC 2017
Sorry for asking in dev maillist, but it really looks like dev issue.
I'm writing application which relies on novaclient, glanceclient, etc.
It's almost done, but I thought about adding end to end tests by
recording and actual requests and replies to openstack. I used httpretty
library for this. Unfortunately, it ignores all requests and unable to
record them.
Does someone knew anything about httpretty and novaclient interaction?
(I think keystoneauth1 and other openstack clients behaves the same way?).
Code example:
import httpretty
from keystoneauth1 import identity
from keystoneauth1 import session
import novaclient.client
auth_data = {'tenant_name':'any', 'username': 'any', 'password': 'any',
'auth_url': 'https://google.com/does-not-matter/'}
with httpretty.HTTPretty.record('test.json'):
auth = identity.v2.Password(**auth_data)
s = session.Session(auth=auth)
cl = novaclient.client.Client('2', session=s)
z = cl.flavors.find(name='SSD.30')
Thanks!
More information about the OpenStack-dev
mailing list