Fix tests and lint

This commit is contained in:
Liam Young 2014-09-04 14:43:19 +00:00
parent eac17d3e18
commit 3436322529
3 changed files with 9 additions and 3 deletions

View File

@ -10,10 +10,12 @@ from charmhelpers.contrib.hahelpers.cluster import (
determine_apache_port,
)
def get_l2population():
plugin = config('neutron-plugin')
return config('l2-population') if plugin == "ovs" else False
class ApacheSSLContext(context.ApacheSSLContext):
interfaces = ['https']

View File

@ -127,6 +127,7 @@ class NeutronAPIContextsTest(CharmTestCase):
'external_network': 'bob',
'neutron_bind_port': self.api_port,
'verbose': True,
'l2_population': True,
}
with patch.object(napi_ctxt, '_ensure_packages'):
self.assertEquals(ctxt_data, napi_ctxt())

View File

@ -30,6 +30,9 @@ TO_PATCH = [
'determine_ports',
'do_openstack_upgrade',
'execd_preinstall',
'get_iface_for_address',
'get_l2population',
'get_netmask_for_address',
'is_leader',
'is_relation_made',
'log',
@ -40,8 +43,6 @@ TO_PATCH = [
'relation_ids',
'relation_set',
'unit_get',
'get_iface_for_address',
'get_netmask_for_address',
]
NEUTRON_CONF_DIR = "/etc/neutron"
@ -256,10 +257,12 @@ class NeutronAPIHooksTests(CharmTestCase):
self._call_hook('neutron-api-relation-changed')
self.assertTrue(self.CONFIGS.write.called_with(NEUTRON_CONF))
def test_neutron_plugin_api_relation_joined(self):
def test_neutron_plugin_api_relation_joined_nol2(self):
_relation_data = {
'neutron-security-groups': False,
'l2-population': False,
}
self.get_l2population.return_value = False
self._call_hook('neutron-plugin-api-relation-joined')
self.relation_set.assert_called_with(
relation_id=None,