def test_amqp_changed_api_rel(self, configs, cell_joined, api_joined,
quantum_joined, mock_is_db_initialised,
update_db_allowed, init_db_allowed):
self.relation_ids.side_effect = [
['nova-cell-api/0'],
['nova-api/0'],
['quantum-service/0'],
]
mock_is_db_initialised.return_value = False
configs.complete_contexts = MagicMock()
configs.complete_contexts.return_value = ['amqp']
configs.write = MagicMock()
self.os_release.return_value = 'diablo'
self.is_relation_made.return_value = True
hooks.amqp_changed()
self.assertEqual(configs.write.call_args_list,
[call('/etc/nova/nova.conf')])
cell_joined.assert_called_with(rid='nova-cell-api/0')
api_joined.assert_called_with(rid='nova-api/0')
quantum_joined.assert_called_with(rid='quantum-service/0',
remote_restart=True)
test_nova_cc_hooks.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录