Fix test_amqp_changed_with_data_and_quantum to take into account the neutron-api relation check and add additional test to check neutron conf isn't written when relation is present

This commit is contained in:
Liam Young 2014-06-24 14:43:19 +01:00
parent 0f59e514bc
commit c38fd8ec3d

View File

@ -170,11 +170,19 @@ class NovaComputeRelationsTests(CharmTestCase):
@patch.object(hooks, 'CONFIGS')
def test_amqp_changed_with_data_and_quantum(self, configs):
self.relation_ids.return_value = []
self._amqp_test(configs, quantum=True)
self.assertEquals([call('/etc/nova/nova.conf'),
call('/etc/quantum/quantum.conf')],
configs.write.call_args_list)
@patch.object(hooks, 'CONFIGS')
def test_amqp_changed_with_data_and_quantum_api(self, configs):
self.relation_ids.return_value = ['neutron-plugin:0']
self._amqp_test(configs, quantum=True)
self.assertEquals([call('/etc/nova/nova.conf')],
configs.write.call_args_list)
def test_db_joined(self):
self.unit_get.return_value = 'nova.foohost.com'
self.is_relation_made.return_value = False