More unit tests
This commit is contained in:
@@ -35,6 +35,7 @@ TO_PATCH = [
|
||||
'execd_preinstall',
|
||||
'filter_installed_packages',
|
||||
'get_dvr',
|
||||
'get_l3ha',
|
||||
'get_l2population',
|
||||
'get_overlay_network_type',
|
||||
'is_relation_made',
|
||||
@@ -276,10 +277,48 @@ class NeutronAPIHooksTests(CharmTestCase):
|
||||
_relation_data = {
|
||||
'neutron-security-groups': False,
|
||||
'enable-dvr': False,
|
||||
'enable-l3ha': False,
|
||||
'l2-population': False,
|
||||
'overlay-network-type': 'vxlan',
|
||||
}
|
||||
self.get_dvr.return_value = False
|
||||
self.get_l3ha.return_value = False
|
||||
self.get_l2population.return_value = False
|
||||
self.get_overlay_network_type.return_value = 'vxlan'
|
||||
self._call_hook('neutron-plugin-api-relation-joined')
|
||||
self.relation_set.assert_called_with(
|
||||
relation_id=None,
|
||||
**_relation_data
|
||||
)
|
||||
|
||||
def test_neutron_plugin_api_relation_joined_dvr(self):
|
||||
_relation_data = {
|
||||
'neutron-security-groups': False,
|
||||
'enable-dvr': True,
|
||||
'enable-l3ha': False,
|
||||
'l2-population': True,
|
||||
'overlay-network-type': 'vxlan',
|
||||
}
|
||||
self.get_dvr.return_value = True
|
||||
self.get_l3ha.return_value = False
|
||||
self.get_l2population.return_value = True
|
||||
self.get_overlay_network_type.return_value = 'vxlan'
|
||||
self._call_hook('neutron-plugin-api-relation-joined')
|
||||
self.relation_set.assert_called_with(
|
||||
relation_id=None,
|
||||
**_relation_data
|
||||
)
|
||||
|
||||
def test_neutron_plugin_api_relation_joined_l3ha(self):
|
||||
_relation_data = {
|
||||
'neutron-security-groups': False,
|
||||
'enable-dvr': False,
|
||||
'enable-l3ha': True,
|
||||
'l2-population': False,
|
||||
'overlay-network-type': 'vxlan',
|
||||
}
|
||||
self.get_dvr.return_value = False
|
||||
self.get_l3ha.return_value = True
|
||||
self.get_l2population.return_value = False
|
||||
self.get_overlay_network_type.return_value = 'vxlan'
|
||||
self._call_hook('neutron-plugin-api-relation-joined')
|
||||
|
||||
Reference in New Issue
Block a user