[openstack-dev] Horizon unit test .. flavors/extra specs

Bhandaru, Malini K malini.k.bhandaru at intel.com
Thu Sep 13 22:02:13 UTC 2012


Hello All!

Would appreciate any suggestions to fix my errors. Trying to mimic the tests in flavors for flavors/extras.tests.py
The UI works but the tests do not ..  details is something that crops up only when obtaining a flavor list.
Regards
Malini

Error message:
  exceptions.handle(request, _("Unable to create/edit extra spec."))
  File "/opt/stack/horizon/horizon/dashboards/syspanel/flavors/extras/forms.py", line 51, in handle
    api.nova.flavor_set_keys(request, flavor_id, { key: data['value']})
  File "/opt/stack/horizon/horizon/api/nova.py", line 262, in flavor_set_keys
    flavor = novaclient(request).flavors.get(flavor_id)
  File "/opt/stack/horizon/.venv/local/lib/python2.7/site-packages/novaclient/v1_1/flavors.py", line 57, in get
    return self._get("/flavors/%s" % base.getid(flavor), "flavor")
  File "/opt/stack/horizon/.venv/local/lib/python2.7/site-packages/novaclient/base.py", line 140, in _get
    _resp, body = self.api.client.get(url)
  File "/opt/stack/horizon/.venv/local/lib/python2.7/site-packages/novaclient/client.py", line 199, in get
    return self._cs_request(url, 'GET', **kwargs)
  File "/opt/stack/horizon/.venv/local/lib/python2.7/site-packages/novaclient/client.py", line 186, in _cs_request
    **kwargs)
  File "/opt/stack/horizon/.venv/local/lib/python2.7/site-packages/novaclient/client.py", line 168, in _time_request
    resp, body = self.request(url, method, **kwargs)
 File "/opt/stack/horizon/.venv/local/lib/python2.7/site-packages/novaclient/client.py", line 162, in request
    raise exceptions.from_response(resp, body)
  File "/opt/stack/horizon/.venv/local/lib/python2.7/site-packages/novaclient/exceptions.py", line 153, in from_response
    request_id=request_id)
TypeError: fake_init_exception() got an unexpected keyword argument 'details'

-----------------------------------------------------------

class FlavorExtrasTests(test.BaseAdminViewTests):
    def test_extra_create(self):
        flavor = self.flavors.first()
        create_url = '/syspanel/flavors/%s/extras/create/' % (flavor.id)
        index_url = '/syspanel/flavors/%s/extras/' % (flavor.id)

        #get create
        data = {'flavor_id': flavor.id, 'origkey': 'None', 'key':'k1', 'value': 'v1'}
        resp = self.client.post(create_url, data)
        self.assertEqual(resp.status_code, 200)
        self.assertTemplateUsed(resp, 'syspanel/flavors/extras/extra_spec.html')

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20120913/caf2405a/attachment.html>


More information about the OpenStack-dev mailing list