Fix test_ids_ctxt test due to charmhelpers change.
The unit_tests.test_neutron_api_context.
IdentityServiceContext.test_ids_ctxt test failed due to a change in
charmhelpers[1] which introduced app data. This introduced a new
function check into the IdentityServiceContext (remote_service_name())
which wasn't mocked out.
- c-h sync to bring in latest/master version of c-h
- mock out the remote_service_name()
[1] 4137a3d5d676ed6f332504b4edfcdf7f06c2f0bc (charm-helpers)
Change-Id: I052b1d837674cadfbdcf4e0975ef5cf82b800a72
This commit is contained in:
@@ -326,6 +326,8 @@ class IdentityServiceContext(CharmTestCase):
|
||||
self.test_config.set('region', 'region457')
|
||||
self.test_config.set('prefer-ipv6', False)
|
||||
|
||||
@patch.object(charmhelpers.contrib.openstack.context,
|
||||
'remote_service_name')
|
||||
@patch.object(charmhelpers.contrib.openstack.context, 'os_release')
|
||||
@patch.object(charmhelpers.contrib.openstack.context, 'format_ipv6_addr')
|
||||
@patch.object(charmhelpers.contrib.openstack.context, 'context_complete')
|
||||
@@ -335,7 +337,7 @@ class IdentityServiceContext(CharmTestCase):
|
||||
@patch.object(charmhelpers.contrib.openstack.context, 'log')
|
||||
@patch.object(charmhelpers.core.hookenv, 'related_units')
|
||||
def test_ids_ctxt(self, _runits1, _log, _rids, _runits2, _rget, _ctxt_comp,
|
||||
format_ipv6_addr, _os_release):
|
||||
format_ipv6_addr, _os_release, _remote_svc_name):
|
||||
_os_release.return_value = 'rocky'
|
||||
_rids.return_value = 'rid1'
|
||||
_runits2.return_value = 'runit'
|
||||
@@ -351,7 +353,7 @@ class IdentityServiceContext(CharmTestCase):
|
||||
'internal_host': '127.0.0.4',
|
||||
'internal_port': 5432,
|
||||
}
|
||||
_rget.return_value = id_data
|
||||
_rget.side_effect = [None, id_data]
|
||||
ids_ctxt = context.IdentityServiceContext()
|
||||
self.assertEqual(ids_ctxt()['region'], 'region457')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user