示例#1
0
 def test_image_service_missing_relation_data(self, configs):
     configs.complete_contexts = MagicMock()
     configs.complete_contexts.return_value = []
     hooks.image_service_changed()
     self.log.assert_called_with(
         'image-service relation incomplete. Peer not ready?'
     )
 def test_image_service_missing_relation_data(self, configs):
     configs.complete_contexts = MagicMock()
     configs.complete_contexts.return_value = []
     hooks.image_service_changed()
     self.log.assert_called_with(
         'image-service relation incomplete. Peer not ready?'
     )
 def test_image_service_with_relation_data(self, configs):
     configs.complete_contexts = MagicMock()
     configs.write = MagicMock()
     configs.complete_contexts.return_value = ['image-service']
     hooks.image_service_changed()
     configs.write.assert_called_with('/etc/nova/nova.conf')
 def test_image_service_with_relation_data(self, configs):
     configs.complete_contexts = MagicMock()
     configs.write = MagicMock()
     configs.complete_contexts.return_value = ['image-service']
     hooks.image_service_changed()
     configs.write.assert_called_with('/etc/nova/nova.conf')