Some LBaaS API test returns wrong data

Bug #1360279 reported by Akihiro Motoki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Low
Akihiro Motoki

Bug Description

In some LBaaS API test, mocked neutronclient API returns Horizon internal objects instead of a dictionary returned from neutronclient.

diff --git a/openstack_dashboard/test/api_tests/lbaas_tests.py b/openstack_dashboard/test/api_tests/lbaas_tests.py
index f393e2a..e0cf693 100644
--- a/openstack_dashboard/test/api_tests/lbaas_tests.py
+++ b/openstack_dashboard/test/api_tests/lbaas_tests.py
@@ -57,7 +57,8 @@ class LbaasApiTests(test.APITestCase):
                         'admin_state_up': vip1['admin_state_up']
                         }

- neutronclient.create_vip({'vip': vipform_data}).AndReturn(vipform_data)
+ neutronclient.create_vip({'vip': vipform_data}).AndReturn(
+ {'vip': vipform_data})
         self.mox.ReplayAll()

         form_data = dict(vipform_data)
@@ -196,9 +197,9 @@ class LbaasApiTests(test.APITestCase):
         api.neutron.subnet_get(self.request, subnet.id).AndReturn(subnet)
         neutronclient.show_vip(pool.vip_id).AndReturn(vip_dict)
         neutronclient.list_members(pool_id=pool.id).AndReturn(
- {'members': self.members.list()})
+ {'members': self.api_members.list()})
         neutronclient.list_health_monitors(id=pool.health_monitors).AndReturn(
- {'health_monitors': [self.monitors.first()]})
+ {'health_monitors': [self.api_monitors.first()]})
         self.mox.ReplayAll()

         ret_val = api.lbaas.pool_get(self.request, pool.id)

Tags: neutron
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/116295

Changed in horizon:
status: New → In Progress
Akihiro Motoki (amotoki)
tags: added: neutron
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/116295
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=d83d6fe8e31d8a83d998a7716bd7e31a409561d6
Submitter: Jenkins
Branch: master

commit d83d6fe8e31d8a83d998a7716bd7e31a409561d6
Author: Akihiro Motoki <email address hidden>
Date: Fri Aug 22 23:22:33 2014 +0900

    Correct return values of mocked methods in LBaaS API test

    Mocked methods of neutronclient should return data structure
    which neutronclient returns, but Horizon internal API object
    (which inherits APIDictWrapper) is returned so far.

    Change-Id: Ifbaeea3234bc232c8bbd2bb6ed2dd8f236358d1b
    Closes-Bug: #1360279

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: juno-3 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.