From c38fd8ec3d0c817bb9e46bf2e7bdf46fd0c31c0b Mon Sep 17 00:00:00 2001 From: Liam Young Date: Tue, 24 Jun 2014 14:43:19 +0100 Subject: [PATCH] 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 --- unit_tests/test_nova_compute_hooks.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/unit_tests/test_nova_compute_hooks.py b/unit_tests/test_nova_compute_hooks.py index 2cfa815e..48ec1bbf 100644 --- a/unit_tests/test_nova_compute_hooks.py +++ b/unit_tests/test_nova_compute_hooks.py @@ -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